Created
September 9, 2015 23:44
-
-
Save hallister/7a450c921a9907a87cd9 to your computer and use it in GitHub Desktop.
No prop errors on es6 class that renders a React.createElement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
export class RenderTest extends React.Component { | |
static propTypes = {}; | |
static defaultProps = { | |
component: 'div' | |
}; | |
render() { | |
let { dog, cat, stuff, ...other } = this.props; | |
return React.createElement( | |
this.props.component, | |
other, | |
this.props.children | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment