element-web/test/components/stub-component.js

21 lines
463 B
JavaScript
Raw Normal View History

/* A dummy React component which we use for stubbing out app-level components
*/
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() {
return <div>{ this.displayName }</div>;
};
}
return createReactClass(opts);
2020-01-13 21:28:33 +01:00
}