@serenity-is/corelib / createRef
Function: createRef()
createRef<
T>():RefObject<T>
Defined in: ../domwise/dist/index.d.ts:2593
Creates a new sealed RefObject whose current is initially null.
The returned object is Object.sealed so that no new properties can be
added, matching the React.createRef contract.
Type Parameters
T
T = any
Type of the value held by the ref.
Returns
RefObject<T>
A sealed RefObject<T> with current set to null.
Example
const inputRef = createRef<HTMLInputElement>();
return <input ref={inputRef} />;
// later: inputRef.current?.focus();