You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In advanced scenarios where you need more control over the rendering performance, mapDispatchToProps() can also return a function. In this case, that function will be used as mapDispatchToProps() for a particular component instance. This allows you to do per-instance memoization. You can refer to issue.
Example:
constmapStateToPropsFactory: MapStateToPropsFactory<StateProps,OwnProps,State>=()=>{// Example selectorconstmySelector=makeMySelector();return(state,ownProps)=>{returnmySelector(state,ownProps);}}exportdefaultconnect(mapStateToPropsFactory)(MyComponent);
In case you return any or other type, you will get an error which can confuse you. When you don't define the return type of this function, it will work, but I rather want to be strict.
The text was updated successfully, but these errors were encountered:
In advanced scenarios where you need more control over the rendering performance, mapDispatchToProps() can also return a function. In this case, that function will be used as mapDispatchToProps() for a particular component instance. This allows you to do per-instance memoization. You can refer to issue.
Example:
In case you return
any
or other type, you will get an error which can confuse you. When you don't define the return type of this function, it will work, but I rather want to be strict.The text was updated successfully, but these errors were encountered: