salsita / prism

React / Redux action composition made simple http://salsita.github.io/prism/
496 stars 24 forks source link

React context access #55

Closed krzysztofpniak closed 7 years ago

krzysztofpniak commented 7 years ago

How can I access React 'context'? https://facebook.github.io/react/docs/context.html I'm trying to implement form library that is compatible with redux-elm and I would like to pass form name down to fields. I know it's not the best solutions, but at the moment I don't see any other options. Anyways, I realized that I cannot access react context inside components wrapped by view(). I took a look on the source code and it looks that you are not passing second parameter, and it seems to be the origin of my problem.

namjul commented 7 years ago

This should work independent of using view(). Context is not to be passed down. thats why it exists.

tomkis commented 7 years ago

@namjul is right, basically you just need to define contextTypes and should be passing that automatically.