Getting started
Last updated
Was this helpful?
Was this helpful?
import { useFlag } from "@reflag/react-sdk";
const MyFlag = () => {
const { isEnabled } = useFlag("my-new-flag");
return isEnabled ? "You have access!" : null;
};<ReflagProvider
publishableKey=""
context={}
toolbar={true}
>import { useFlag } from "@reflag/react-sdk";
const MyFlag = () => {
const { isEnabled, track, requestFeedback } = useFlag("my-new-flag");
if (!isEnabled) {
return null;
}
return (
<>
<button onClick={() => track()}>Try it</button>
<button
onClick={() => requestFeedback({ title: "How do you like this new release?" })}
>
Give feedback
</button>
</>
);
}