- First way is to create the
bind
and pass the props yourself
class Foo {
constructor(props) {
this.props = props
this.render = this.render.bind(this)
}
render(props) {
return <span baz={props.baz} qux={this.props.qux} />
}
}
- Second is to import the JSXComponent
import JSXComponent from 'jsx-render/lib/JSXComponent'
class Foo extends JSXComponent {
render(props) {
return <span baz={props.baz} qux={this.props.qux} />
}
}
...
function Bar() {
return <Foo baz="100vw" qux="100vh" />
}
JSXComponent
also includes a copy of events, read the Events recipe.