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

21 lines
452 B
JavaScript
Raw Normal View History

2016-03-28 17:24:27 +01:00
/* A dummy React component which we use for stubbing out app-level components
*/
import React from 'react';
2016-03-28 17:24:27 +01:00
2021-06-29 13:11:58 +01:00
export default function({ displayName = "StubComponent", render } = {}) {
2020-08-29 12:14:16 +01:00
if (!render) {
render = function() {
2020-08-29 13:02:45 +01:00
return <div>{ displayName }</div>;
2017-10-11 17:56:17 +01:00
};
2016-03-31 00:48:46 +01:00
}
2020-08-29 12:14:16 +01:00
return class extends React.Component {
static displayName = displayName;
render() {
return render();
}
};
2020-01-13 13:28:33 -07:00
}