mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
18 lines
424 B
TypeScript
18 lines
424 B
TypeScript
import React from 'react';
|
|
|
|
import { SECOND } from 'lib/consts';
|
|
|
|
import { growthBook } from './init';
|
|
|
|
export default function useLoadFeatures() {
|
|
React.useEffect(() => {
|
|
growthBook?.setAttributes({
|
|
...growthBook.getAttributes(),
|
|
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
language: window.navigator.language,
|
|
});
|
|
|
|
growthBook?.loadFeatures({ timeout: SECOND });
|
|
}, []);
|
|
}
|