Skip to content

Latest commit

 

History

History
37 lines (24 loc) · 895 Bytes

README.md

File metadata and controls

37 lines (24 loc) · 895 Bytes

react-global CI npm version

React library to access global variables using a hook.

Installation

npm install @imod-ch/react-global --save

# or

yarn add @imod-ch/react-global

Usage

import { FC } from 'react';
import { useGlobal } from '@imod-ch/react-global';

const SampleComponent: FC = () => {
  const [globalVariable, setGlobalVariable] =
    useGlobal<string>('globalVariable');

  return <p>{globalVariable}</p>;
};

License

MIT

Contributors