element-web-Github/test/components/stub-component.js
2021-06-29 13:11:58 +01:00

21 lines
452 B
JavaScript

/* A dummy React component which we use for stubbing out app-level components
*/
import React from 'react';
export default function({ displayName = "StubComponent", render } = {}) {
if (!render) {
render = function() {
return <div>{ displayName }</div>;
};
}
return class extends React.Component {
static displayName = displayName;
render() {
return render();
}
};
}