Hi team. is this a acceptable practice to use mult...
# ask-questions
c
Hi team. is this a acceptable practice to use multiple useFeature in a page ?
Copy code
const Sample: React.FC = () => {
  const feature1 = useFeature('feature1');
  const feature2 = useFeature('feature2');

  return (
    <>
      <Button color={feature.value || 'blue'}>feature1</Button>
      <Button color={feature.value || 'blue'}>feature2</Button>
    </>
  );
};

export default Sample;
And also do we get experiment for multiple a/b testings in trackingCallback: async (experiment, result) ?
w
the trackingCallback gets called once for each feature.
1
c
Thanks, so can I expect two logs in the following code ? ( with enabled namespaces )
Copy code
trackingCallback: async (experiment, result) => {
    console.log(experiment, '<<<<<');
  },
I only see one log for the two experiment:
w
You could expect two logs if both features are in a test. I suspect an A/B test was not set up for one of them.
👀 1
b
you may also want to check the FAQ for when the tracking callback gets called as it isn't called in all cases: https://docs.growthbook.io/faq#why-is-the-trackingcallback-not-firing-in-the-sdk