const UpdatedComponent = (Original Component) => {
class NewComponent extends React.Component {
constructor(){
this.state = {
...
}
}
render(){
return(
<OriginalComponent props/>
);
}
}
return NewComponent;
};
class OGComponent extends React.Component{
...
//available via (this.props..)
}
export default UpdatedComponent(OGComponent);
Source link
lol