[FIX] hooks: useSubEnv will not erase previous useChildSubEnv

This commit is contained in:
Bruno Boi
2022-01-31 14:38:00 +01:00
committed by Aaron Bohy
parent 722abd6d5f
commit 4d68dac24d
3 changed files with 50 additions and 2 deletions
+1 -2
View File
@@ -45,9 +45,8 @@ function extendEnv(currentEnv: Object, extension: Object): Object {
*/
export function useSubEnv(envExtension: Env) {
const node = getCurrent()!;
const newEnv = extendEnv(node.component.env as any, envExtension);
node.component.env = extendEnv(node.component.env as any, envExtension);
node.childEnv = newEnv;
useChildSubEnv(envExtension);
}
export function useChildSubEnv(envExtension: Env) {