the component returned to the class wrapper using high-level components cannot be rendered correctly, but the component return can be rendered directly, and the problem can not be found. Please advise. Thank you
function HOC(WrappedComponent){
//
return class HOC extends Component {
render(){
const newProps = {type:"HOC"};
return <WrappedComponent {...this.props} {...newProps}/>
}
}
//
// return function newRender(props){
// return <WrappedComponent />
// }
}
class OriginComponent extends Component {
render(){
return <div></div>
}
}
const newComponent = HOC(OriginComponent)
class TestHOCCom extends Component{
constructor(){
super()
this.state = {
}
}
render() {
// console.log(newComponent, 9999999)
return (
<div>
<newComponent />
</div>
)
}
}
export default TestHOCCom