Skip to content

Suggestion: @connect's shouldComponentUpdate could be optional or opt-in #88

@dallonf

Description

@dallonf

The @connect decorator, by default, appears to add a very aggressive shouldComponentUpdate hook to the decorated component. This is great if Redux and props are the only sources of statefulness in your app - but that's not always true and leads to some seriously confusing behavior with non-obvious workarounds when it's not.

This is a known issue, of course, with react-router 0.13, but I'm having the same issue with react-intl's IntlMixin, which adds localization data to context. And I get the feeling that this is going to keep happening as long as the React ecosystem is as fragmented as it is right now.

It would be really nice to just be able to throw an option on the @connected components that I know are impure (or, similar to React core's PureRenderMixin, throw an option on the ones I know are pure; there's certainly room for debate as to whether opt-in or opt-out is the right choice here).

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