Skip to content
This repository was archived by the owner on Nov 23, 2021. It is now read-only.

Commit 9931e0c

Browse files
committed
Tweaked readme.
1 parent 5d51e68 commit 9931e0c

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# create-react-context
1+
# mini-create-react-context
22

3-
> Polyfill for the [proposed React context API](https://github.com/reactjs/rfcs/pull/2)
3+
> (A smaller) Polyfill for the [proposed React context API](https://github.com/reactjs/rfcs/pull/2)
44
55
## Install
66

77
```sh
8-
yarn add create-react-context
8+
npm install create-react-context
99
```
1010

1111
You'll need to also have `react` and `prop-types` installed.
@@ -14,9 +14,17 @@ You'll need to also have `react` and `prop-types` installed.
1414

1515
```js
1616
const Context = createReactContext(defaultValue);
17-
// <Context.Provider value={providedValue}>{children}</Context.Provider>
18-
// ...
19-
// <Context.Consumer>{value => children}</Context.Consumer>
17+
/*
18+
<Context.Provider value={providedValue}>
19+
{children}
20+
</Context.Provider>
21+
22+
...
23+
24+
<Context.Consumer>
25+
{value => children}
26+
</Context.Consumer>
27+
*/
2028
```
2129

2230
## Example
@@ -74,9 +82,7 @@ class Title extends React.Component<{ children: Node }> {
7482

7583
## Compatibility
7684

77-
This package only "ponyfills" the `React.createContext` API, not other
78-
unrelated React 16+ APIs. If you are using a version of React <16, keep
79-
in mind that you can only use features available in that version.
85+
This package only "ponyfills" the `React.createContext` API, not other unrelated React 16+ APIs. If you are using a version of React <16, keep in mind that you can only use features available in that version.
8086

8187
For example, you cannot pass children types aren't valid pre React 16:
8288

0 commit comments

Comments
 (0)