import * as React from "react"; import * as ReactDOM from "react-dom"; import { GrowthBookProvider, GrowthBook, useExperiment, } from "@growthbook/growthbook-react"; import { GrowthBookDev } from ".."; const gb = new GrowthBook({ user: { id: "123", }, trackingCallback: (exp, res) => { console.log("track", exp, res); }, }); const Headline = () => { const { value } = useExperiment({ key: "headline-copy", variations: ["Hello World", "Hola Mundo"], }); return

{value}

; }; const Button = () => { const { value: background } = useExperiment({ key: "button-color", variations: ["red", "green", "blue"], }); return ( ); }; const NewFeature = () => { const { value } = useExperiment({ key: "new-feature", variations: [false, true], }); if (!value) return null; return (
This is a shiny new feature!
); }; const Playground = () => { return ( <>