Skip to content

Using connect() with Immutable.Map state object #60

@ghost

Description

My store is an Immutable.Map object, and I would like to pass it down my tree of React components. I suppose that in most cases I can get good performance by using something like PureRenderMixin (or ES2015 equivalent) when doing so.

I started out simple decorating my App class with @connect(state => state), and I got this error:

“Uncaught Error: Invariant Violation: mapStateToProps must return an object. Instead received Map {…”

I’m able to do something like @connect(state => {return {state};}), and then unwrap the object in App’s render(), but I get the sense that this is not an ideal solution.

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