JSPM

react-safe-context-hooks

0.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9
  • Score
    100M100P100Q42169F
  • License MIT

Make sure context exists

Package Exports

  • react-safe-context-hooks

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-safe-context-hooks) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-safe-context-hooks

NPM version NPM downloads NPM license Codecov Travis Bundle size

About

Make sure context exists

Demo

Live – check website Playground – play with library in Storybook

Similar Projects / Alternatives / Idea

How to Install

First, install the library in your project by npm:

$ npm install react-safe-context-hooks

Or Yarn:

$ yarn add react-safe-context-hooks

Getting Started

• Import hook in React application file:

import { useSafeContext } from 'react-safe-context-hooks';

Returned Values

Example

// before

const App = () => {
  const context = useContext(ExampleContext);

  return ();
};

// after

const App = () => {
  const context = useSafeContext(ExampleContext);

  return ();
};

License

This project is licensed under the MIT License © 2020-present Jakub Biesiada