trying first time and getting this error. Anyone k...
# ask-questions
s
trying first time and getting this error. Anyone knows how to solve this? Error in function feature in ./node_modules/@growthbook/growthbook-react/dist/esm/index.js:51 growthbook.feature is not a function.
f
Hi Arpan - I assume this with the react SDK implementation?
s
yes
f
can you share the code where you're adding the sdk?
s
yes in global layout
message has been deleted
and they trying to use in components like this
const myFeature = useFeature("open-account-link").on;
console.log(myFeature)
trying to run equal split a/b test. api returns this
*{*"status": *200*,
"features": *{*"open-account-link": *{*"defaultValue": *false*,
"rules": *[{*"variations": *[false*,
true
*]*,
"coverage": *1*,
"weights": *[0.5*,
0.5
*]*,
"key": "open-account-link",
"hashAttribute": "id"
}
]
}
}
}
f
that looks correct
s
is there any mistake I made in a/b test config in growthbook cloud?
message has been deleted
should I keep ON for both variations in SERVE table?
f
the UI side looks good
are you still getting that JS error?
s
yes
f
It looks like in the GrowthBookProvider, you accidentally passed in a string instead of the growthbook object
đź‘Ť 1
f
oh good catch
didn't see the quotes
s
thanks. trying again
I am confused by serve table in growthbook. Not sure when should I turn it ON or OFF? Also when Name is used. I don’t see name included in API response
f
those two cases in your experiment rule have two different values (on and off) it's up to you to see whatever values you want - if you set them to the same, you'll be running an A/A test
The experiment key, I assume you mean, is used in the trackingCallback - you should see it in your console log
s
so for a/b test which should I leave one on and another off?
f
it doesn't matter really - but typically 0'th index is the control (so off)
s
ok and by name I mean next column values which is default and fivision in pic I shared. I don’t see those in api response
what are they used for?
f
oh, thats for growthbook users
sometimes 'on' and 'off' are hard to parse - so you can use that name for something more understandable - like 'showing new version of x'
s
what is difference between features and experiments in growthbook dev tools?
I set both to true but I still see below code return false
useFeature("open-account-link").on
f
whats the json returning now?
s
you mean api response? wouldn’t it be same as previous as we have just changed it in devtools but not actually changed it?
f
oh
I've sometimes had some problems with the devtools - you can make sure the SDK is working correctly by adjusting the id: "123" to something else to rebucket you, and see if you get the other variations
the devtools is just for debugging
s
oh marketing team can’t use that dev tools to swap different variations at will?