Closed lalitdotdev closed 4 months ago
Only workaround i found was letting TS not enforce strict typing rules on the dynamic import statement by casting the imported Editor component as any.
const Editor = dynamic<{}>(
() => import("react-draft-wysiwyg").then((mod) => mod.Editor as any),
{ ssr: false },
) as any;
Closing the issue.
Error Message:
Issue: Encountered a TypeScript error related to the dynamic import of the
Editor
component using thedynamic
function.Steps to Reproduce:
Editor
component using thedynamic
function.Expected Behavior: The
dynamic
function should correctly infer the return type of the importedEditor
component, ensuring compatibility with the specified parameter type.Actual Behavior: Encountered a TypeScript error indicating a type mismatch between the return type of the dynamic import and the expected parameter type (
DynamicOptions<{}> | Loader<{}>
).Environment:
Code Snippet: