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
the options according to the doc shall take an Object for the corresponding React root
the actual error message shall be this way
'Warning: You passed an options object as the second argument to `hydrateRoot(...)`, did you forget to pass a React element?',
or if someone passes a JSX element to options
'You passed a JSX element as an options to hydrateRoot. You probably meant to ' +
'call root.render instead. ' +
'Example usage:\n\n' +
' let root = hydrateRoot(domContainer, <App />, {...options});\n' +
' root.render(<App />);',
The text was updated successfully, but these errors were encountered:
We're going more in the direction of not adding runtime checks for these issues, since the typesystem can catch this without adding additional runtime/bundle cost in DEV.
while working with the
hydrateRoot
call i forgot to pass the React Element () that shall be passed for it to work,like below
React version:
Steps To Reproduce
Check this codesanbox URL
Link to code example:
The current behavior
we get to see this error
The expected behavior
if i try to uncomment the
root.render()
call, we see that the actual error is now being shownScreen.Recording.2024-09-04.at.7.40.42.PM.mov
thought the error message needs to be aligned in the context of the validation error from the
createRoot
https://react.dev/reference/react-dom/client/hydrateRoot#hydrateroot
the options according to the doc shall take an Object for the corresponding React root
the actual error message shall be this way
or if someone passes a JSX element to options
The text was updated successfully, but these errors were encountered: