mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Add pass to lower useState
This commit is contained in:
1 parent
403881c548
commit
4571979e46
2 files changed
+16
No files matched your search
@@ -7,6 +7,7 @@
|
||||
|
||||
import { NodePath } from "@babel/traverse";
|
||||
import * as t from "@babel/types";
|
||||
import { lowerUseState } from "../Forest";
|
||||
import {
|
||||
HIRFunction,
|
||||
ReactiveFunction,
|
||||
@@ -245,6 +246,15 @@ export function* run(
|
||||
value: reactiveFunction,
|
||||
});
|
||||
|
||||
if (config?.enableForest) {
|
||||
lowerUseState(reactiveFunction);
|
||||
yield log({
|
||||
kind: "reactive",
|
||||
name: "LowerUseState",
|
||||
value: reactiveFunction,
|
||||
});
|
||||
}
|
||||
|
||||
promoteUsedTemporaries(reactiveFunction);
|
||||
yield log({
|
||||
kind: "reactive",
|
||||
|
||||
@@ -28,3 +28,9 @@ export { pruneTemporaryLValues as pruneUnusedLValues } from "./PruneTemporaryLVa
|
||||
export { pruneUnusedLabels } from "./PruneUnusedLabels";
|
||||
export { pruneUnusedScopes } from "./PruneUnusedScopes";
|
||||
export { renameVariables } from "./RenameVariables";
|
||||
export {
|
||||
ReactiveFunctionTransform,
|
||||
Transformed,
|
||||
eachReactiveValueOperand,
|
||||
visitReactiveFunction,
|
||||
} from "./visitors";
|
||||
Reference in new issue
Block a user