@lynx-js/react / MainThreadRef
Class: MainThreadRef<T>
A MainThreadRef is a ref that can only be accessed on the main thread. It is used to preserve
states between main thread function calls.
The data saved in current property of the MainThreadRef can be read and written in
multiple main thread functions.
Extends
WorkletRef<T>
Type Parameters
Constructors
new MainThreadRef()
Parameters
Returns
Overrides
WorkletRef<T>.constructor
Defined in
@lynx-js/react/runtime/lib/worklet/ref/workletRef.d.ts:15
Accessors
current
Get Signature
Returns
T
Set Signature
Parameters
Returns
void
Inherited from
WorkletRef.current
Defined in
@lynx-js/react/runtime/lib/worklet/ref/workletRef.d.ts:4