This is the dev preview website. Check out the document at lynxjs.org

Home > @lynx-js/react > useGlobalProps

useGlobalProps() function

A React Hooks for you to get lynx.__globalProps. If lynx.__globalProps is changed, a re-render will be triggered automatically.

Signature:

useGlobalProps: () => GlobalProps

Returns:

GlobalProps

Example

function App() {
  const globalProps = useGlobalProps();

  globalProps.someProperty // use it
}