-
Notifications
You must be signed in to change notification settings - Fork 114
Fix DynamicModuleLoader and remove support for React-Redux 5 #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
if (this.props.reactReduxContext !== this._memoizedRRContext) { | ||
this._memoizedRRContext = { | ||
...this.props.reactReduxContext, | ||
storeState: this.props.reactReduxContext.store.getState(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we memoizing state only when context changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the state changes above, then we will get a new context object here.
this.setState({...}) returns a new object
packages/redux-dynamic-modules-react/src/DynamicModuleLoader.tsx
Outdated
Show resolved
Hide resolved
Please add some unit tests ... did you test all the examples with these changes? |
|
||
createStore?: () => IModuleStore<any>; | ||
interface IDynamicModuleLoaderImplProps extends IDynamicModuleLoaderProps { | ||
reactReduxContext?: { store: IModuleStore<any> }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doc comments.
throw new Error( | ||
"Store could not be resolved from React context" | ||
public render(): React.ReactNode { | ||
if (this.state.readyToRender) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What comments are you looking for here? This seems pretty self explanatory to me
This PR fixes:
ReactReduxContext
, so do that here.createStore
prop, we were not providing a modified context to the first connected component. Now, if we callcreateStore
and render aProvider
, we will render another instance ofDynamicModuleLoader
, which will actually add the modules.react-redux@5
This should result in a major version bump to V4