react_wrappers library

Utilities for handling over_react wrapped react components.

Properties

$r → dynamic
Returns a reference to the currently selected component in the React Dev Tools.
no setter

Functions

chainRef(ReactElement element, CallbackRef? newCallbackRef) CallbackRef?
Returns a function that chains the callback or createRef-based ref of the provided element with newCallbackRef.
cloneElement(ReactElement element, [Map? props, Iterable? children]) ReactElement
Dart wrapper for React.cloneElement.
createPortal(dynamic children, Element container) → ReactPortal
Returns a portal that renders children into a container.
findDomNode(dynamic instance) Element?
Returns the DOM node associated with a mounted React component instance, which can be a ReactComponent/Element or react.Component2.
getDartComponent<T extends Component>(dynamic instance) → T?
Returns the native Dart component associated with a mounted component instance.
getInstanceKey(ReactElement instance) → dynamic
Returns the ReactElement.key associated with the specified instance.
getInstanceRef(ReactElement instance) → dynamic
Returns the ReactElement.ref associated with the specified instance.
getProps(dynamic instance, {bool traverseWrappers = false}) Map
Returns an unmodifiable Map view of props for a ReactElement or composite ReactComponent instance.
isDartComponent(Object? instance) bool
Returns whether an instance is a native Dart component (a react-dart ReactElement or ReactComponent).
isDomElement(dynamic instance) bool
Returns whether instance is a ReactElement for a DOM node.
isValidElement(dynamic object) bool
Dart wrapper for React.isValidElement.
preparePropsChangeset(ReactElement element, Map? newProps, [Iterable? newChildren]) → dynamic
Returns a new JS map with the specified props and children changes, properly prepared for consumption by React JS methods such as cloneElement, setProps, and other methods that accept changesets of props to be merged into existing props.

Typedefs

CallbackRef = dynamic Function(dynamic ref)
A function that, when supplied as ReactPropsMixin.ref, is called with the component instance as soon as it is mounted.