From 8d1f2aeef1caaf8d4e9e480ddb3589a247b35d80 Mon Sep 17 00:00:00 2001 From: Gerrit Alex Date: Wed, 26 Feb 2020 11:23:15 +0100 Subject: [PATCH 1/3] add docs of IDynamicModuleLoaderProps to readme --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 09c4b55..78a4934 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,23 @@ const store: IModuleStore = createStore({
Hello World!!
+ + +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 From 22e970b5fc1eec9029b07454032d0c2051f24ab7 Mon Sep 17 00:00:00 2001 From: Gerrit Alex Date: Wed, 26 Feb 2020 11:54:43 +0100 Subject: [PATCH 2/3] update docs --- docs/reference/DynamicModuleLoader.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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; +} +``` From 56209804c69cd03bf29b2757e976b44050593a65 Mon Sep 17 00:00:00 2001 From: Gerrit Alex Date: Wed, 26 Feb 2020 11:55:24 +0100 Subject: [PATCH 3/3] change readme highlighting to typescript --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 78a4934..8a42f07 100644 --- a/README.md +++ b/README.md @@ -90,8 +90,8 @@ const store: IModuleStore = createStore({
Hello World!!
- - +``` +```typescript export interface IDynamicModuleLoaderProps { /** Modules that need to be dynamically registerd */ modules: IModuleTuple;