Skip to content

Commit ca2aa68

Browse files
authored
feat(use-growthbook): export type on provider init (#1518)
Co-authored-by: Antoine Caron <[email protected]>
1 parent e841e13 commit ca2aa68

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

.changeset/few-peas-dream.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@scaleway/use-growthbook': patch
3+
---
4+
5+
Export directly some usable type on provider init attributes

packages/use-growthbook/src/AbTestProvider.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ export type ToolConfig = {
1111

1212
export type TrackingCallback = NonNullable<Context['trackingCallback']>
1313

14+
export type ErrorCallback = (error: Error | string) => void
15+
1416
export type AbTestProviderProps = {
1517
children: ReactNode
1618
config: ToolConfig
1719
trackingCallback: TrackingCallback
18-
errorCallback: (error: Error | string) => void
20+
errorCallback: ErrorCallback
1921
attributes: Attributes
2022
loadConfig?: LoadConfig
2123
}

packages/use-growthbook/src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ export type {
1313
} from '@growthbook/growthbook-react'
1414
export { useAbTestAttributes } from './useAbTestAttributes'
1515
export { AbTestProvider } from './AbTestProvider'
16+
export type {
17+
TrackingCallback,
18+
ErrorCallback,
19+
ToolConfig,
20+
} from './AbTestProvider'

0 commit comments

Comments
 (0)