You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Where in the source code does choo handle the return value of route handler functions (the hyperx html)? I see where where the router sets the handler, but I don't see where choo takes that return value and renders it.
The text was updated successfully, but these errors were encountered:
Thanks. FWIW, I think the router auto-rendering is an anti-pattern. Everywhere else, one does the rendering manually (see beginner's guide). By returning htmlx in route functions, there is no direct way to attach logic to elements after they are appended. I use MutationObserver to listen for renders, and then make a callback out of the app emitter in my templates. Am I doing it wrong?
Having automatic rendering on navigation I think is very much the responsibility of a framework such as choo. For reacting to updates and routing on the component level, you'd probably want to use nanocomponent (which comes with choo). It has lifecycle hooks for load/unload behavior among some other niceties. See the documentation here: https://github.com/choojs/choo#components
Where in the source code does choo handle the return value of route handler functions (the hyperx html)? I see where where the router sets the handler, but I don't see where choo takes that return value and renders it.
The text was updated successfully, but these errors were encountered: