You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PR was automatically generated via the update-sdk-docs GitHub
workflow.
Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com>
Signed-off-by: wadii <wadii.zaim@flagsmith.com>
The `FeatureFlag` component supports the following props:
227
+
228
+
-**`flagKey`** (required): The feature flag key to evaluate
229
+
-**`defaultValue`** (required): Default value when the flag is not available
230
+
-**`matchValue`** (required, except for boolean flags): Value to match against the flag value. By default, an optimized deep-comparison function is used.
231
+
-**`predicate`** (optional): Custom function for matching logic that receives the expected value and evaluation details
232
+
-**`children`**: Content to render when condition is met (can be JSX or a function receiving flag details)
233
+
-**`fallback`** (optional): Content to render when condition is not met
234
+
171
235
#### Multiple Providers and Domains
172
236
173
237
Multiple providers can be used by passing a `domain` to the `OpenFeatureProvider`:
@@ -310,8 +374,8 @@ The [OpenFeature debounce hook](https://github.com/open-feature/js-sdk-contrib/t
310
374
### Testing
311
375
312
376
The React SDK includes a built-in context provider for testing.
313
-
This allows you to easily test components that use evaluation hooks, such as `useFlag`.
314
-
If you try to test a component (in this case, `MyComponent`) which uses an evaluation hook, you might see an error message like:
377
+
This allows you to easily test components that use evaluation hooks (such as `useFlag`) or declarative components (such as `FeatureFlag`).
378
+
If you try to test a component (in this case, `MyComponent`) which uses feature flags, you might see an error message like:
315
379
316
380
> No OpenFeature client available - components using OpenFeature must be wrapped with an `<OpenFeatureProvider>`.
317
381
@@ -332,6 +396,16 @@ If you'd like to control the values returned by the evaluation hooks, you can pa
Additionally, you can pass an artificial delay for the provider startup to test your suspense boundaries or loaders/spinners impacted by feature flags:
0 commit comments