UNPKG

react-intlayer

Version:

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

1 lines 677 B
{"version":3,"file":"useLoadDynamic.mjs","names":[],"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":";;;AAEA,MAAa,kBAAqB,MAAc,YAA2B;;CAEzE,MAAM,gBAAgB,MAAM,MAAM,YAAY,MAAM,QAAQ,EAAE;AAK9D,QAFmB,MAAM,IAAI,cAAc"}