ember-react
ember-react copied to clipboard
props not being passed through to react component
Using the react
helper like in the readme, e.g. {{react componentName='mycomponent' foo=bar }}
this.props.foo
inside the react component is not set. Not working for Ember 1.13+.
Are you able to get it working at all with Ember 1.13+
? Or just having issues with props
. I can't seem to get it working at all due to js errors being thrown like: Uncaught TypeError: Cannot read property 'toUpperCase' of undefined
It's highly possible some of the Ember internal's this depends upon have changed. Unfortunately I don't have the bandwidth to dig into this right now.
Digging into it a big, what I've found so far:
- The
type
paramater in theautoGenerateWrapperClass
function (React) is undefined, and it's trying to calltoUpperCase()
ontype
, which is why the error is occuring - Going a little deeper, looking into the
ember-react
code, specifically in theReactComponent renderReact()
function it is creating a variablereactClass
, which to my knowledge so far is responsible for thattype
param that React uses. And inside of therenderReact
function thereactClass
variable is undefined
I'll post anything else if I uncover more
I ended up getting it working by not using jsx
and opting for vanilla javascript in the react
component.
Testing passing in props worked as well