React library to access global variables using a hook.
npm install @imod-ch/react-global --save
# or
yarn add @imod-ch/react-global
import { FC } from 'react';
import { useGlobal } from '@imod-ch/react-global';
const SampleComponent: FC = () => {
const [globalVariable, setGlobalVariable] =
useGlobal<string>('globalVariable');
return <p>{globalVariable}</p>;
};
MIT