-
-
Notifications
You must be signed in to change notification settings - Fork 627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot access railsContext in components #763
Comments
Hi @othierry, the docs specify your answer. You need to use a generator function. https://github.com/shakacode/react_on_rails/blob/master/README.md#rails-context |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Congratulation for the great work on react_on_rails! 👍
I have just started trying it out. I am facing an issue where I cannot access the
railsContext
in the constructors of my components. It is always an emptyObject {}
.Tracking down the stack brings me to
node_package/src/createReactElement.js
, because my component is a react component and not a generator function that returns one, it usesReact.createElement(component, props)
thus, discarding therailsContext
.What am I doing wrong ?
The text was updated successfully, but these errors were encountered: