react-lazy-hydration icon indicating copy to clipboard operation
react-lazy-hydration copied to clipboard

Add listenOnEl prop

Open sarink opened this issue 5 years ago • 1 comments

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

sarink avatar Oct 12 '20 18:10 sarink

@ScriptedAlchemy i think you meant to review this PR instead #24 ;)

sarink avatar Dec 02 '20 16:12 sarink