createRef<T> function
Creates a Ref object that can be attached to a ReactElement via the ref prop.
Example:
UiFactory<BasicProps> Basic = _$Basic;
mixin BasicProps on UiProps {}
class BasicComponent extends UiComponent2<BasicProps> {
final Ref<InputElement> inputRef = createRef();
showInputCreateRefValue(_) {
print(inputRef.current.value);
}
@override
render() => Dom.div()(
(Dom.input()
..ref = inputRef
)(),
(Dom.button()
..onClick = showInputCreateRefValue
)('Click this button'),
);
}
Learn more: reactjs.org/docs/refs-and-the-dom.html#creating-refs.
Implementation
Ref<T?> createRef<T>() => react_interop.createRef();