# react-polyfill-context

> React createContext polyfill

Latest version **1.0.12** (published 2021-04-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-polyfill-context
pnpm add react-polyfill-context
yarn add react-polyfill-context
bun add react-polyfill-context
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.12 |
| Published | 2021-04-09 |
| First published | 2019-09-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | huya.nzb |
| Maintainers | kingback |
| Keywords | React, createContext, polyfill |

## Links

- npm: https://www.npmjs.com/package/react-polyfill-context
- Repository: https://github.com/kingback/react-polyfills
- Issues: https://github.com/kingback/react-polyfills/issues
- npm.io page: https://npm.io/package/react-polyfill-context

## Dependencies (2)

- [universal-polyfill-engine](https://npm.io/package/universal-polyfill-engine.md) ^1.0.9
- [universal-polyfill-context](https://npm.io/package/universal-polyfill-context.md) ^1.0.12

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.12 (latest) — 2021-04-09
- 1.0.9 — 2020-03-19
- 1.0.8 — 2019-11-11
- 1.0.4 — 2019-09-07
- 1.0.0 — 2019-09-03

## README

# `react-polyfill-context`

> Polyfill for React new context api

## Support

`>= react@0.14.9`

## Usage

```jsx
import React from 'react';
import { render } from 'react-dom';
import { createContext } from 'react-polyfill-context';
const Context = createContext();

function App() {
  return (
    <div>
      <Context.Consumer>{(value) => (
        <p>{value}</p>
      )}</Context.Consumer>
    </div>
  );
}

render((
  <Context.Provider value={0}>
    <App />
  </Context.Provider>
), document)
```

For more usage, see <https://reactjs.org/docs/context.html#reactcreatecontext>

## Others

You can use it with [react-polyfill-ref](https://www.npmjs.com/package/react-polyfill-ref) and [react-polyfill-hooks](https://www.npmjs.com/package/react-polyfill-hooks)

---
_Source: https://npm.io/package/react-polyfill-context · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
