Browse Source

17 -> future version

main
Alex Krolick 7 years ago
parent
commit
1ead0605c2
  1. 2
      content/docs/context.md
  2. 4
      content/docs/legacy-context.md

2
content/docs/context.md

@ -109,5 +109,5 @@ A more complex example with dynamic values for the theme:
> Note
>
> React previously shipped with an experimental context API. The old API will be supported in all 16.x releases, but applications using it should migrate to the new version. The legacy API will be removed in React 17. Read the [legacy context docs here](/docs/legacy-context.html).
> React previously shipped with an experimental context API. The old API will be supported in all 16.x releases, but applications using it should migrate to the new version. The legacy API will be removed in a future major React versin. Read the [legacy context docs here](/docs/legacy-context.html).

4
content/docs/legacy-context.md

@ -6,7 +6,7 @@ permalink: docs/legacy-context.html
> Note:
>
> The legacy context API will be removed in version 17.
> The legacy context API will be removed in a future major version.
> Use the [new context API](/docs/context.html) introduced with version 16.3.
> The legacy API will continue working for all 16.x releases.
@ -214,4 +214,4 @@ MediaQuery.childContextTypes = {
};
```
The problem is, if a context value provided by component changes, descendants that use that value won't update if an intermediate parent returns `false` from `shouldComponentUpdate`. This is totally out of control of the components using context, so there's basically no way to reliably update the context. [This blog post](https://medium.com/@mweststrate/how-to-safely-use-react-context-b7e343eff076) has a good explanation of why this is a problem and how you might get around it.
The problem is, if a context value provided by component changes, descendants that use that value won't update if an intermediate parent returns `false` from `shouldComponentUpdate`. This is totally out of control of the components using context, so there's basically no way to reliably update the context. [This blog post](https://medium.com/@mweststrate/how-to-safely-use-react-context-b7e343eff076) has a good explanation of why this is a problem and how you might get around it.

Loading…
Cancel
Save