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
(Note that this uses the flushSync-before-append approach in #25101 (comment), but unclear if that's related to how events are bound.)
The current behavior
All event handlers bound with on* props inside the React root rendered to a document fragment don't seem to work. This can be worked around with refs and setting up event listeners.
The expected behavior
I would expect on* props to work the same as React roots rendered to elements.
The text was updated successfully, but these errors were encountered:
React version: 19.0.0
Steps To Reproduce
createRoot
with a document fragment instead of elementonFocus
,onClick
,onSubmit
, etc. event handlers don't workLink to code example:
https://codesandbox.io/p/sandbox/wonderful-tristan-lxwl5d
(Note that this uses the
flushSync
-before-append approach in #25101 (comment), but unclear if that's related to how events are bound.)The current behavior
All event handlers bound with
on*
props inside the React root rendered to a document fragment don't seem to work. This can be worked around with refs and setting up event listeners.The expected behavior
I would expect
on*
props to work the same as React roots rendered to elements.The text was updated successfully, but these errors were encountered: