Skip to content

Instantly share code, notes, and snippets.

@hallister
Created September 9, 2015 23:44
Show Gist options
  • Save hallister/7a450c921a9907a87cd9 to your computer and use it in GitHub Desktop.
Save hallister/7a450c921a9907a87cd9 to your computer and use it in GitHub Desktop.
No prop errors on es6 class that renders a React.createElement
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