Home > @lynx-js/react > useMainThreadObject
useMainThreadObject() function
Create a stable handle that resolves to an object of the supplied type in main-thread functions.
This primitive is intended for library hooks. The returned target type is only callable in a main-thread function; it must not be used from the background runtime.
Signature:
Parameters
Returns:
O
The main-thread-only target type.

