https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
m

millions-author-34878

07/31/2023, 5:01 PM
Copy code
import { getServicosHome } from "../api/areas";
import { useFeatureIsOn, useFeatureValue } from "@growthbook/growthbook-react";
import { useExperiment } from "@growthbook/growthbook-react";

/.../

const newButtonColor = useFeatureIsOn("buttonColor");

// const buttonColor = useFeatureValue("buttonColor", "blue");

const { value } = useExperiment({
  key: "buttoncolor",
  variations: ["blue", "red"],
});

/.../

{newButtonColor ? (
  <p style={{ background: "red" }}>VERMELHO</p>
) : (
  <p style={{ background: "blue" }}>AZUL</p>
)}
7 Views