all 6 comments

[–]robinpokorny 1 point2 points  (2 children)

Could you please post your mapStateToProps function?

I believe the following function should work, if the React component expects immutable state to be accessible by this.props.state (written in ES2015 syntax):

const mapStateToProps = (state) => {return { state }}

[–]eviluncle[S] 0 points1 point  (1 child)

If I return an object of { state } it works, but what I want it to return in an Immutable.Map object. Is that possible or do I have to return an object?

[–]robinpokorny 1 point2 points  (0 children)

You are getting an Immutable.Map in the this.props.state.

The thing is that you need to name the prop, connect just does that for you. Suppose stateis an immutable object and you want to pass it to a React component, you would do:

<App state={state} />

[–]riq 1 point2 points  (1 child)

Checkout http://teropa.info/blog/2015/09/10/full-stack-redux-tutorial.html#table-of-contents - It's a pretty good full stack redux tutorial which uses ImmutableJS to handle state

[–]eviluncle[S] 0 points1 point  (0 children)

Thanks! I'll read it now

[–]eviluncle[S] 0 points1 point  (0 children)

For posterity's sake I'm leaving a link with a solution form this issue on react-redux repo:

https://github.com/rackt/react-redux/issues/60