element-web/test/components/stub-component.js
Travis Ralston 344dac4fb9 Convert CommonJS exports to ES6-compatible exports
We use `export default` begrudgingly here. Ideally we'd use just `export`, though this entire SDK expects things to be exported as a default. Instead of breaking everything, we'll sacrifice our export pattern for a smaller diff - a later commit can always do the default export -> regular export conversion.
2019-12-22 21:01:02 -07:00

20 lines
464 B
JavaScript

/* 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);
};