Closed ajchang84 closed 6 years ago
I'm not sure you are doing it correctly. As far as I know the .apply(this)
call is not necessary because react
automatically binds to this
when calling the render()
function.
Anyway if you still want to maintain the apply()
call, you have to do something like this:
render(props, context) { return template.apply(this, [props, context]) }
// or better
// render(props, context) { return template.call(this, props, context) }
Oops, all this time we've been returning with an .apply(this)! Thanks a lot for the insight
Got it to work now and keep up the great work with react-templates, it's been invaluable.
Dear developers of react-templates,
I have a question about the usage of rt-stateless:
Normally, we render our component templates like this in the javascript:
render() { return template.apply(this) }
However, for rendering of the stateless component, how do I pass in custom props in the javascript to be used in the rt-stateless template?