mirror of
https://github.com/hanzoai/react.git
synced 2026-09-24 17:02:27 +00:00
[compiler][playground] Make change detection work in playground
Summary: The change detection mode was unavailable in the playground because the pragma was not a boolean. This fixes that by special casing it in pragma parsing, similar to validateNoCapitalizedCalls ghstack-source-id: 4a8c17d21ab8b7936ca61c9dd1f7fdf8322614c9 Pull Request resolved: https://github.com/facebook/react/pull/29889
This commit is contained in:
@@ -410,6 +410,17 @@ export function parseConfigPragma(pragma: string): EnvironmentConfig {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (
|
||||
key === "enableChangeDetectionForDebugging" &&
|
||||
(val === undefined || val === "true")
|
||||
) {
|
||||
maybeConfig[key] = {
|
||||
source: "react-compiler-runtime",
|
||||
importSpecifierName: "$structuralCheck",
|
||||
};
|
||||
continue;
|
||||
}
|
||||
|
||||
if (typeof defaultConfig[key as keyof EnvironmentConfig] !== "boolean") {
|
||||
// skip parsing non-boolean properties
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user