element-web/test/components/stub-component.js
Michael Telatynski c120458b81 fix test stub
2020-08-29 13:02:45 +01:00

20 lines
450 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();
}
};
}