diff --git a/README.md b/README.md index 09c4b55..8a42f07 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,23 @@ const store: IModuleStore = createStore({
Hello World!!
``` +```typescript +export interface IDynamicModuleLoaderProps { + /** Modules that need to be dynamically registerd */ + modules: IModuleTuple; + + /** + * Set this flag to indicate that this component is being rendered in 'Strict Mode' + * React 'StrictMode' does not allow constructor side-effects, so we defer adding modules to componentDidMount + * when this flag is set. + * This has the effect of adding a second render. + */ + strictMode?: boolean; + + /** Optional callback which returns a store instance. This would be called if no store could be loaded from th e context. */ + createStore?: () => IModuleStore; +} +``` ## Extensions diff --git a/docs/reference/DynamicModuleLoader.md b/docs/reference/DynamicModuleLoader.md index d60a0a4..ad55c34 100644 --- a/docs/reference/DynamicModuleLoader.md +++ b/docs/reference/DynamicModuleLoader.md @@ -20,3 +20,21 @@ export class NewUserDialog extends React.Component { ``` When `` is rendered, the `newUserDialog` module will be added to the store. When it is unmounted, the module will be removed from the store and the state will be cleaned up. + +Note the props definion for ``: + +```typescript +export interface IDynamicModuleLoaderProps { + /** Modules that need to be dynamically registerd */ + modules: IModuleTuple; + /** + * Set this flag to indicate that this component is being rendered in 'Strict Mode' + * React 'StrictMode' does not allow constructor side-effects, so we defer adding modules to componentDidMount + * when this flag is set. + * This has the effect of adding a second render. + */ + strictMode?: boolean; + /** Optional callback which returns a store instance. This would be called if no store could be loaded from th e context. */ + createStore?: () => IModuleStore; +} +```