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

21 lines
455 B
JavaScript
Raw Normal View History

/* A dummy React component which we use for stubbing out app-level components
*/
import React from 'react';
2020-08-29 11:14:16 +00:00
export default function({displayName = "StubComponent", render} = {}) {
if (!render) {
render = function() {
return <div>{ this.displayName }</div>;
};
}
2020-08-29 11:14:16 +00:00
return class extends React.Component {
static displayName = displayName;
render() {
return render();
}
};
2020-01-13 20:28:33 +00:00
}