UNPKG

react-intlayer

Version:

Easily internationalize i18n your React applications with type-safe multilingual content management.

1 lines 686 B
{"version":3,"sources":["../../../src/server/useLoadDynamic.ts"],"sourcesContent":["import react from 'react';\n\nexport const useLoadDynamic = <T>(_key: string, promise: Promise<T>): T => {\n /** @ts-ignore remove error Property 'cache' does not exist on type 'typeof React'. */\n const cachedPromise = react.cache(async () => await promise)();\n\n /** @ts-ignore remove error Property 'use' does not exist on type 'typeof React'. */\n const dictionary = react.use(cachedPromise);\n\n return dictionary;\n};\n"],"mappings":"AAAA,OAAO,WAAW;AAEX,MAAM,iBAAiB,CAAI,MAAc,YAA2B;AAEzE,QAAM,gBAAgB,MAAM,MAAM,YAAY,MAAM,OAAO,EAAE;AAG7D,QAAM,aAAa,MAAM,IAAI,aAAa;AAE1C,SAAO;AACT;","names":[]}