Skip to content

documentation: inject complete state into component, re-render #709

@ghost23

Description

@ghost23

Hi,

in the documentation:

https://github.com/reactjs/react-redux/blob/master/docs/api.md#inject-dispatch-and-every-field-in-the-global-state

It says, that injecting the complete state into a component is a performance killer, since the component would re-render on every action.

My understanding is, that the component would only re-render on a state change, since the default guards (like areStatesEqual and areStatePropsEqual) would still work. If my understanding is correct and since some actions might only result in a side effect (when using redux-saga, for example), I think the documentation should rather say:

"Don’t do this! It kills any performance optimizations because TodoApp will rerender after every state change."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions