In my application, I use response, redux and immutablejs. The store is unchanged and matched with the requisite. When matching the sending to the details, I provide auxiliary functions. Helper functions are comparable to this piece of code in the redux TodoList example:
const mapDispatchToProps = (dispatch) => {
return {
onTodoClick: (id) => {
dispatch(toggleTodo(id))
}
}
}
The problem now is that my pure components display too often: the connection above creates a function onTodoClickfor each connection. When PureRenderMixin does not deeply compile currentProps for newProps, it marks the component as mustUpdate because the pointers have changed.
How to define helper functions in containers while keeping components low below?
I already looked at reselection, but planned to use it only to calculate the derived state in mapStateToProps. Is it better to just create a selector for each connection, so that your functions are also remembered?
source
share