[IMP] hooks: introduce useChildSubEnv and change useSubEnv

This commit is contained in:
Géry Debongnie
2022-01-24 14:39:12 +01:00
committed by Aaron Bohy
parent e4b4ee471f
commit aa95149997
8 changed files with 183 additions and 31 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ It is sometimes useful to add one (or more) specific keys to the environment,
from the perspective of a specific component and its children. In that case, the
solution presented above will not work, since it sets the global environment.
There is a hook for this situation: [`useSubEnv`](hooks.md#usesubenv).
There are two hooks for this situation: [`useSubEnv` and `useChildSubEnv`](hooks.md#usesubenv-and-usechildsubenv).
```js
class SomeComponent extends Component {