react-lazy-hydration
react-lazy-hydration copied to clipboard
Add listenOnEl prop
Relevant lines to review:
- https://github.com/hadeeb/react-lazy-hydration/pull/25/files#diff-38682f47b0cf12c516bc3714fc45d0fdR158-R170
- https://github.com/hadeeb/react-lazy-hydration/pull/25/files#diff-38682f47b0cf12c516bc3714fc45d0fdR32-R35
Adds a listenOnEl prop to allow the consumer to specify which element to listen on for events. In my use case, I want to hydrate as soon as an event happens anywhere on the document, rather than on the child element.
Pairs nicely with the new noWrapper prop.
This is currently in draft mode because it depends on some of the other PRs I submitted (these lines will conflict with the changes in https://github.com/hadeeb/react-lazy-hydration/pull/24) , I can rebase it if it's reviewed/accepted. Until then, I'll be using it on my fork
@ScriptedAlchemy i think you meant to review this PR instead #24 ;)