mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
No need to spread a filtered array
This commit is contained in:
+1
-5
@@ -43,11 +43,7 @@ export function inferEffectDependencies(
|
||||
if (fnExpr != null) {
|
||||
const deps: ArrayExpression = {
|
||||
kind: 'ArrayExpression',
|
||||
elements: [
|
||||
...fnExpr.loweredFunc.dependencies.filter(
|
||||
place => place.reactive,
|
||||
),
|
||||
],
|
||||
elements: fnExpr.loweredFunc.dependencies.filter(place => place.reactive),
|
||||
loc: GeneratedSource,
|
||||
};
|
||||
|
||||
|
||||
-2
@@ -14,7 +14,6 @@ function Component({foo, bar}) {
|
||||
console.log(localNonreactive);
|
||||
console.log(globalValue);
|
||||
});
|
||||
|
||||
|
||||
// Optional chains and property accesses
|
||||
// TODO: we may be able to save bytes by omitting property accesses if the
|
||||
@@ -22,7 +21,6 @@ function Component({foo, bar}) {
|
||||
useEffect(() => {
|
||||
console.log(bar?.baz);
|
||||
console.log(bar.qux);
|
||||
|
||||
});
|
||||
|
||||
function f() {
|
||||
|
||||
Reference in New Issue
Block a user