Create React Context
@hypnosphi/create-react-context
Polyfill for the proposed React context API
Utilities
react
context
contextTypes
polyfill
ponyfill
@hypnosphi/create-react-context
Utilities
javascript
npm
frontend
Stars
685
Weekly
1.1M
Open issues
9
Bundle
~25 kB
Installation
npm install @hypnosphi/create-react-contextCode example
import { useCreateReactContext } from "@hypnosphi/create-react-context";
export function Example() {
const value = useCreateReactContext();
return <p>{String(value)}</p>;
}Pros & cons
Pros
- Actively maintained by James Kyle
- 1.1M weekly downloads. Battle tested
- First-class TypeScript definitions
- MIT licensed
Considerations
- Adds roughly ~25 kB to your bundle
- Needs client-only rendering in SSR frameworks
- Not supported in React Native
- 9 open issues on GitHub