Closed joker-777 closed 9 years ago
ReactRedux.connect
doesn't mutate the component class. It returns a new component class. So, you have to do something like:
ConnectedCustomQuizCreator = ReactRedux.connect(mapStateToProps)(CustomQuizCreator)
# ...
React.render(
React.createElement(ReactRedux.Provider, {store},
-> React.createElement(ConnectedCustomQuizCreator)
),
$('#modal_custom_quiz')[0]
)
@joker-777 not super familiar with coffeescript but @billyjanitsch 's analysis seems to be spot on.
Closing but let me know if the provided solution doesn't resolve the issue.
@billyjanitsch Thanks so much for your answer. This really fixed it. Could you explain why I have to do this but the documentation doesn't show it. Maybe it is part of this export default
but I have no idea. It would be also nice to add it to the documentation.
Hi,
thanks for your awesome work. I use
react
,redux
andreact-redux
for a small feature of my Ruby on Rails project. I don't use npm and require and thats why I use the browserified versions of these libs. I also use coffeescript and decided against using jsx. I somehow can't manage to connect my store to my react component. The code looks like thisI hope you guys can help me to figure out what is wrong.
Thanks,
Johannes