We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e094a39 commit ed31476Copy full SHA for ed31476
.changeset/grumpy-coats-worry.md
@@ -0,0 +1,5 @@
1
+---
2
+'@primer/react': minor
3
4
+
5
+Broaden feature flag type for experimental FeatureFlags to accept undefined
packages/react/src/FeatureFlags/FeatureFlagScope.ts
@@ -1,5 +1,5 @@
export type FeatureFlags = {
- [key: string]: boolean
+ [key: string]: boolean | undefined
}
export class FeatureFlagScope {
@@ -24,7 +24,10 @@ export class FeatureFlagScope {
24
flags: Map<string, boolean>
25
26
constructor(flags: FeatureFlags = {}) {
27
- this.flags = new Map(Object.entries(flags))
+ this.flags = new Map()
28
+ for (const [key, value] of Object.entries(flags)) {
29
+ this.flags.set(key, value ?? false)
30
+ }
31
32
33
/**
0 commit comments