-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What would be a good way to trigger a tree update but from outside of XML? #774
Comments
After looking into the way it's designed around navigation I think that the easiest way to do this is to just rerender whole page while an app would be multiple pages in size. But then it defeats the purpose to talk about how you can represent the whole app with one XML file because now you need to have a file per screen -- just like in HTML. |
Hi @Invertisment , I'm not sure I quite follow. Can you describe what you're trying to achieve in an app that you've built? We don't have an equivalent to hx-swap-oob. Typically if we want to update multiple parts of a screen, we either:
|
I want to trigger an event from outside of Hyperview component |
For instance in HTMX they have hx-swap-oob and you can instantiate that raw HTML snippet to swap it into the DOM according to rules of
hx-swap-oob
.This allows to morph the DOM in some weird ways.
It doesn't need to be completely generic but it would work even if I could take a single XML string and swap it into an element from outside.
What I try to understand if it's possible to use useRef to hold a reference to some kind of handler inside of
Hyperview
component where I could just submit small snippet of new XML to (not whole reload). And I'd expect this XML to run and change something in the existing app tree.For instance I could have a fully rendered Hyperview component but then I'd want to handle a callback from the other part of React application that's not Hyperview -- then I could submit XML to some part of the app to be rendered on the spot.
If this is hard to do then my things may also be implementable by firing events. But to fire the events I'd have to fire them to somewhere and I'd still expect to then use something like
useRef
to take theHyperview
instance and fire the events into it (for instance if I get a push notification).The text was updated successfully, but these errors were encountered: