1.1.1 • Published 2 years ago

@imod-ch/react-global v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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