hydrateRoot
Same as createRoot()
, but is used to hydrate a container whose HTML contents were rendered by ReactDOMServer.
React will attempt to attach event listeners to the existing markup.
Example Usage
hydrateRoot(document.querySelector('#root'), <App />)
function hydrateRoot(
container: Element | Document,
initialChildren: React.ReactNode,
options?: HydrationOptions,
): Root;