@schematichq/schematic-react 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3149,9 +3149,10 @@ var useSchematicEvents = () => {
|
|
3149
3149
|
var useSchematicFlag = (key, fallback) => {
|
3150
3150
|
const { flagValues } = useSchematic();
|
3151
3151
|
const [value, setValue] = (0, import_react.useState)(fallback ?? false);
|
3152
|
+
const flagValue = flagValues[key];
|
3152
3153
|
(0, import_react.useEffect)(() => {
|
3153
|
-
typeof
|
3154
|
-
}, [key, fallback,
|
3154
|
+
typeof flagValue === "undefined" ? setValue(fallback ?? false) : setValue(flagValue);
|
3155
|
+
}, [key, fallback, flagValue]);
|
3155
3156
|
return value;
|
3156
3157
|
};
|
3157
3158
|
/*! Bundled license information:
|
@@ -3132,9 +3132,10 @@ var useSchematicEvents = () => {
|
|
3132
3132
|
var useSchematicFlag = (key, fallback) => {
|
3133
3133
|
const { flagValues } = useSchematic();
|
3134
3134
|
const [value, setValue] = (0, import_react.useState)(fallback ?? false);
|
3135
|
+
const flagValue = flagValues[key];
|
3135
3136
|
(0, import_react.useEffect)(() => {
|
3136
|
-
typeof
|
3137
|
-
}, [key, fallback,
|
3137
|
+
typeof flagValue === "undefined" ? setValue(fallback ?? false) : setValue(flagValue);
|
3138
|
+
}, [key, fallback, flagValue]);
|
3138
3139
|
return value;
|
3139
3140
|
};
|
3140
3141
|
export {
|
package/package.json
CHANGED
@@ -12,6 +12,8 @@
|
|
12
12
|
"esbuild": "^0.19.9",
|
13
13
|
"esbuild-jest": "^0.5.0",
|
14
14
|
"eslint": "^8.55.0",
|
15
|
+
"eslint-plugin-import": "^2.29.1",
|
16
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
15
17
|
"jest": "^29.7.0",
|
16
18
|
"jest-environment-jsdom": "^29.7.0",
|
17
19
|
"jest-esbuild": "^0.3.0",
|
@@ -40,7 +42,7 @@
|
|
40
42
|
"test": "jest --config jest.config.js"
|
41
43
|
},
|
42
44
|
"types": "dist/schematic-react.d.ts",
|
43
|
-
"version": "0.1.
|
45
|
+
"version": "0.1.2",
|
44
46
|
"dependencies": {
|
45
47
|
"@schematichq/schematic-js": "^0.1.2"
|
46
48
|
},
|