Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 27x 2565x 1123x 1123x 1123x 1123x 1123x | import useIntlKeyStore from '../useIntlKeyStore';
const useIntlKey = (passedIntlKey, passedIntlNS) => {
const getKey = useIntlKeyStore(state => state.getKey);
let intlKey;
Iif (passedIntlKey) {
intlKey = passedIntlKey;
} else Iif (passedIntlNS) {
intlKey = getKey(passedIntlNS);
} else {
intlKey = getKey();
}
Iif (!intlKey) {
throw new Error('Stripes kint components requires an intl key to be either configured via `addKey` from `useIntlKeyStore` or passed directly into components');
}
return intlKey;
};
export default useIntlKey;
|