Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/demos/ContextChangeDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
OpenFeatureProvider,
useBooleanFlagDetails,
useFlag,
useContextMutator,
} from "@openfeature/react-sdk";
import { Suspense } from "react";
import { useSearchParams } from "react-router-dom";
Expand Down Expand Up @@ -74,14 +75,18 @@ function Content() {
}

function ContextChangeButton() {
const {
mutateContext,
} = useContextMutator();

return (
<span>
<span>Click </span>
<button
onClick={() => {
OpenFeature.setContext(PROVIDER_NAME, {
mutateContext(PROVIDER_NAME, {
silly: !OpenFeature.getContext(PROVIDER_NAME).silly,
});
})
}}
>
here
Expand Down