Skip to content

Commit eb8bda1

Browse files
authored
Merge pull request #1 from w01fgang/claude/fix-feature-gate-switch-y4Woq
Fix FeatureGate and FeatureSwitch components
2 parents 552b6a1 + 608b59e commit eb8bda1

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "feature-gate",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "A library for handling features in large-scale React apps",
55
"main": "./lib/cjs/index.js",
66
"module": "./lib/esm/index.js",

src/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ type ProviderProps = {
2222
} & Rules;
2323

2424
type ConsumerProps = {
25-
children: ReactElement | string | number,
26-
fallback?: ReactElement | string | number,
25+
children: ReactElement,
26+
fallback?: ReactElement,
2727
name: string,
2828
};
2929

3030
type SwitchProps = {
31-
children: ReactElement | string | number,
32-
fallback: ReactElement | string | number,
31+
children: ReactElement,
32+
fallback: ReactElement,
3333
name: string,
3434
};
3535

@@ -65,7 +65,7 @@ export function FeatureGate({ children, name, fallback }: ConsumerProps) {
6565
}
6666

6767
if (fallback !== undefined && !isValidElement(fallback)) {
68-
console.error("Children prop is not a valid react element");
68+
console.error("Fallback prop is not a valid react element");
6969
return null;
7070
}
7171

0 commit comments

Comments
 (0)