andypf / json-viewer

MIT License
29 stars 1 forks source link

dynamic import next.js #11

Closed arastepa closed 1 month ago

arastepa commented 1 month ago

Hello does this library work with dynamic import? I get error when using dynamic import Type '{ data: string; indent: number; expanded: number; theme: string; showDataTypes: boolean; showToolbar: boolean; showCopy: boolean; showSize: boolean; expandIconType: string; }' is not assignable to type 'IntrinsicAttributes'. Property 'data' does not exist on type 'IntrinsicAttributes'.

Screenshot from 2024-09-12 20-38-03 Screenshot from 2024-09-12 20-37-26

arastepa commented 1 month ago

fixed: const JsonViewer = dynamic( () => import('@andypf/json-viewer/dist/esm/react/JsonViewer'), { ssr: false }, ) as typeof import('@andypf/json-viewer/dist/esm/react/JsonViewer');

andypf commented 1 month ago

so, it's fixed? Can I close this issue?

arastepa commented 1 month ago

Yes