|
5 | 5 | [npm-badge]: https://img.shields.io/npm/v/react-broadcast.svg?style=flat-square
|
6 | 6 | [npm]: https://www.npmjs.com/package/react-broadcast
|
7 | 7 |
|
8 |
| -[`react-broadcast`](https://www.npmjs.com/package/react-broadcast) provides a reliable way for React |
9 |
| -components to propagate state changes to their descendants deep in the component hierarchy, |
10 |
| -bypassing intermediaries who `return false` from |
11 |
| -[`shouldComponentUpdate`](https://reactjs.org/docs/react-component.html#shouldcomponentupdate). |
12 |
| - |
13 |
| -It was originally built to solve issues that arose from using |
14 |
| -[`react-router`](https://www.npmjs.com/package/react-router) together with |
15 |
| -[`react-redux`](https://www.npmjs.com/package/react-redux). The router needed a safe way to |
16 |
| -communicate state changes to `<Link>`s deep in the component hierarchy, but `react-redux` relies on |
17 |
| -`shouldComponentUpdate` for performance. `react-broadcast` allows the router to work seamlessly with |
18 |
| -Redux and any other component that uses `shouldComponentUpdate`. |
19 |
| - |
20 |
| -**Please note:** As with anything that uses [context](https://reactjs.org/docs/context.html), this |
21 |
| -library is experimental. It may cease working in some future version of React. For now, it's a |
22 |
| -practical workaround for the router. If we discover some better way to do things in the future, rest |
23 |
| -assured we'll do our best to share what we learn. |
| 8 | +[`react-broadcast`](https://www.npmjs.com/package/react-broadcast) provides a reliable way for React components to propagate state changes to their descendants deep in the component hierarchy, bypassing intermediaries who `return false` from [`shouldComponentUpdate`](https://reactjs.org/docs/react-component.html#shouldcomponentupdate). |
24 | 9 |
|
25 |
| -## Installation |
| 10 | +It was originally built to solve issues that arose from using [`react-router`](https://www.npmjs.com/package/react-router) together with [`react-redux`](https://www.npmjs.com/package/react-redux). The router needed a safe way to communicate state changes to `<Link>`s deep in the component hierarchy, but `react-redux` relies on `shouldComponentUpdate` for performance. `react-broadcast` allows the router to work seamlessly with Redux and any other component that uses `shouldComponentUpdate`. |
| 11 | + |
| 12 | +**Please note:** As with anything that uses [context](https://reactjs.org/docs/context.html), this library is experimental. It may cease working in some future version of React. For now, it's a practical workaround for the router. If we discover some better way to do things in the future, rest assured we'll do our best to share what we learn. |
26 | 13 |
|
27 |
| -Using [yarn](https://yarnpkg.com/): |
| 14 | +## Installation |
28 | 15 |
|
29 |
| - $ yarn add react-broadcast |
| 16 | + $ npm install --save react-broadcast |
30 | 17 |
|
31 | 18 | Then, use as you would anything else:
|
32 | 19 |
|
@@ -105,6 +92,4 @@ Enjoy!
|
105 | 92 |
|
106 | 93 | ## About
|
107 | 94 |
|
108 |
| -react-broadcast is developed and maintained by [React Training](https://reacttraining.com). If |
109 |
| -you're interested in learning more about what React can do for your company, please [get in |
110 |
| - |
| 95 | +react-broadcast is developed and maintained by [React Training ](https://reacttraining.com). If you're interested in learning more about what React can do for your company, please [get in touch ](mailto:[email protected])! |
0 commit comments