2017-08-25 16:24:13 -04:00

15 lines
321 B
JavaScript

import React from 'react';
class PreviewHOC extends React.Component {
shouldComponentUpdate(nextProps) {
return nextProps.value !== this.props.value;
}
render() {
const { previewComponent, ...props } = this.props;
return React.createElement(previewComponent, props);
}
}
export default PreviewHOC;