Remove create-react-class
This commit is contained in:
parent
672d0fe97b
commit
72498df28f
108 changed files with 3059 additions and 3545 deletions
|
@ -2,19 +2,19 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import createReactClass from 'create-react-class';
|
||||
|
||||
export default function(opts) {
|
||||
opts = opts || {};
|
||||
if (!opts.displayName) {
|
||||
opts.displayName = 'StubComponent';
|
||||
}
|
||||
|
||||
if (!opts.render) {
|
||||
opts.render = function() {
|
||||
export default function({displayName = "StubComponent", render} = {}) {
|
||||
if (!render) {
|
||||
render = function() {
|
||||
return <div>{ this.displayName }</div>;
|
||||
};
|
||||
}
|
||||
|
||||
return createReactClass(opts);
|
||||
return class extends React.Component {
|
||||
static displayName = displayName;
|
||||
|
||||
render() {
|
||||
return render();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue