react_dom library
Exposes a typed version of react_dom.render
and react_dom.unmountComponentAtNode
from the react
package so that over_react
consumers
do not have to declare a direct dependency on the react
package in their pubspec.yaml
.
This allows us to insulate our consumers from "breaking" internal changes in the react
package.
It is strongly suggested that consumers namespace when importing this library to avoid collisions when creating custom
UiComponent
s.
import 'package:over_react/react_dom.dart' as react_dom;
import 'package:over_react/over_react.dart';
Functions
-
render(
ReactNode? element, Element mountNode) → dynamic -
Renders the provided
element
into the DOM mounted in the providedmountNode
and returns a reference to it based on its type: -
unmountComponentAtNode(
Element mountNode) → bool -
Removes a React
Component
from the DOM that was mounted via render and cleans up its event handlers and state.