mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[compiler] In change detection, be less precise about path dependencies
ghstack-source-id: 0d3837641c
Pull Request resolved: https://github.com/facebook/react/pull/30489
This commit is contained in:
+5
-1
@@ -1442,7 +1442,11 @@ function codegenDependency(
|
||||
): t.Expression {
|
||||
let object: t.Expression = convertIdentifier(dependency.identifier);
|
||||
if (dependency.path !== null) {
|
||||
for (const path of dependency.path) {
|
||||
let depPath = dependency.path;
|
||||
if (cx.env.config.enableChangeDetection != null && depPath.length > 0) {
|
||||
depPath = depPath.slice(0, -1)
|
||||
}
|
||||
for (const path of depPath) {
|
||||
object = t.memberExpression(object, t.identifier(path));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user