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
Adds an improvement to the React SDK which supports re-renders if the
[flags
changed](https://open-feature.github.io/js-sdk/types/_openfeature_server_sdk.ConfigChangeEvent.html)
array from a provider event is falsy.
Since some providers have no knowledge of flags which are changed, this
allows them to support dynamic re-rendering by not defining this
property. If the prop is null/undefined, we diff all flags... If the
property is explicitly set to an empty array, that means no flags have
changed and the React SDK skips all diff checks.
Signed-off-by: Todd Baert <[email protected]>
Copy file name to clipboardexpand all lines: packages/react/README.md
+5-2
Original file line number
Diff line number
Diff line change
@@ -233,14 +233,17 @@ function Page() {
233
233
}
234
234
```
235
235
236
-
Note that if your provider doesn't support updates, this configuration has no impact.
236
+
If your provider doesn't support updates, this configuration has no impact.
237
+
238
+
> [!NOTE]
239
+
> If your provider includes a list of [flags changed](https://open-feature.github.io/js-sdk/types/_openfeature_server_sdk.ConfigChangeEvent.html) in its `PROVIDER_CONFIGURATION_CHANGED` event, that list of flags is used to decide which flag evaluation hooks should re-run by diffing the latest value of these flags with the previous render.
240
+
> If your provider event does not the include the `flags changed` list, then the SDK diffs all flags with the previous render to determine which hooks should re-run.
237
241
238
242
#### Suspense Support
239
243
240
244
> [!NOTE]
241
245
> React suspense is an experimental feature and is subject to change in future versions.
242
246
243
-
244
247
Frequently, providers need to perform some initial startup tasks.
245
248
It may be desirable not to display components with feature flags until this is complete or when the context changes.
246
249
Built-in [suspense](https://react.dev/reference/react/Suspense) support makes this easy.
0 commit comments