Class | Description |
---|---|
MainThreadRef | 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. |
Function | Description |
---|---|
runOnBackground(f) | runOnBackground allows triggering js functions on the background thread asynchronously. |
runOnMainThread(fn) | runOnMainThread allows triggering main thread functions on the main thread asynchronously. |
useEffect(effect, deps) | Accepts a function that contains imperative, possibly effectful code. The effects run after main thread dom update without blocking it. |
useInitData() | A React Hooks for you to get initData . If initData is changed, a re-render will be triggered automatically. |
useInitDataChanged(callback) | A React Hooks for you to get notified when initData changed. |
useLayoutEffect(effect, deps) |
Accepts a function that contains imperative, possibly effectful code. The effects run after main thread dom update without blocking it. |
useLynxGlobalEventListener(eventName, listener) | useLynxGlobalEventListener help you addListener as early as possible. |
useMainThreadRef(initValue) | Create A A It is a hook and it should only be called at the top level of your component. |
useMainThreadRef(initValue) | Create A A It is a hook and it should only be called at the top level of your component. |
useMainThreadRef() | Create A A It is a hook and it should only be called at the top level of your component. |
withInitDataInState(App) | Higher-Order Component (HOC) that injects This HOC checks if the provided component is a class component. If it is, it wraps the component and injects the |
Interface | Description |
---|---|
DataProcessorDefinition | Definition of DataProcessor(s) |
InitData | The interface you can extends so that the Should be used with |
InitDataRaw | The interface you can extends so that the Should be used with |
Lynx | APIs under lynx global variable that added by ReactLynx. |
Root | The default root exported by @lynx-js/react for you to render a JSX |
Variable | Description |
---|---|
InitDataConsumer | The Consumer Component that provide initData . This should be used with InitDataProvider Components |
InitDataProvider | The Provider Component that provide initData , you must wrap your JSX inside it Components |
root | The default and only root of ReactLynx for you to render JSX |