@scaleway/use-growthbook
Version:
Utility package to expose AB test tool
14 lines (13 loc) • 376 B
JavaScript
import { useGrowthBook } from "@growthbook/growthbook-react";
const useAbTestAttributes = () => {
const growthBook = useGrowthBook();
const attributes = growthBook.getAttributes();
const setAttributes = (newAttributes) => growthBook.setAttributes({
...attributes,
...newAttributes
});
return [attributes, setAttributes];
};
export {
useAbTestAttributes
};