Open ChromeQ opened 2 years ago
@ChromeQ is there a way we can use your fork as a temporary solution?
I've tried adding it to my packages with yarn add ChromeQ/redux-dynamic-modules
but it looks like it can't find it.
Based on this PR: https://github.com/microsoft/redux-dynamic-modules/pull/192
You can extend 'IDynamicModuleLoaderProps' interface in your *.d.ts (like in global.d.ts). Just add:
declare module 'redux-dynamic-modules-react' {
export interface IDynamicModuleLoaderProps {
/** Explicitly name children as a prop to work with @types/react@18 */
children: React.ReactNode;
}
}
Thanks @mrluscus ! I just want to add that in our case without importing redux-dynamic-modules-react
other error appeared. It was complaining that DynamicModuleLoader
is not exported.
Our solution was:
redux-dynamic-modules-react.d.ts
(optional, you may add lines below to global.d.ts
)
import * as reduxDynamicModulesReact from 'redux-dynamic-modules-react';
declare module 'redux-dynamic-modules-react' { export interface IDynamicModuleLoaderProps { children: React.ReactNode; } }
192 fixes TS errors since DefinitelyTyped updated react types to v18.