Hi! We use the `@growthbook/growthbook-react` -pac...
# ask-questions
Hi! We use the
-package to setup growthbook for our React app. With the introduction of the typesafe sdk we were looking at adding the typing to catch the typos etc. Creating the types (
) with the instructions works well, but when I try to use them when creating the Growthbook-object with the type defined, typescript is complaining with the error
Expected 0 type arguments, but got 1.
Our code looks like this
Copy code
import { GrowthBook } from '@growthbook/growthbook-react';

export const growthbook = new GrowthBook<AppFeatures>({
apiHost: '<https://cdn.growthbook.io>',
	clientKey: ...,
	decryptionKey: ...,
	enableDevMode: ...,
	onFeatureUsage: (featureKey, result) => {
	trackingCallback: (experiment, result) => {
The exported growthbook object is used as
when the app renders the first time. Q: do I need to change to use the
-package instead or create a custom hook by using the
-hook as base?
is a dependency of the react SDK. It's possible it installed an older version of that which doesn't support types yet.
What version of the react SDK are you using?
Ok, the latest version is 0.15.0 so that's why you aren't seeing typed support. If you update to the latest it should work.
gotcha, thanks 👍
sorry, follow up on the last question: any idea why TS isn't complaining about this wrong key?
The react hooks need a little extra setup to work with the types. https://docs.growthbook.io/lib/react#usefeatureisont
🙌 1