Module

React.Basic.DOM.Client

Package
purescript-react-basic-dom
Repository
lumihq/purescript-react-basic-dom

#ReactRoot Source

#createRoot Source

createRoot :: Element -> Effect ReactRoot

Create a React root for the supplied container and return the root. The root can be used to render a React element into the DOM with render. Replaces ReactDOM.render when the .render method is called and enables Concurrent Mode.

#hydrateRoot Source

hydrateRoot :: Element -> JSX -> Effect ReactRoot

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.

#renderRoot Source

renderRoot :: ReactRoot -> JSX -> Effect Unit

Render children in ReactRoot

#unmountRoot Source

unmountRoot :: ReactRoot -> Effect Unit

Unmount the react root