How do components wrapped by react high-level components operate state? within high-level components

wrote a high-level component

const fn=(Com)=>{
    return class A extends Comonents{
        state={
            list
        }
        return <Com  {...this.props}/>
    }
}

const NewCom = fn(Com);
NewCom  list
May.07,2021

pass the method to the subcomponent, and then call the method in the subcomponent.

const fn=(Com)=>{
    return class A extends Component{
        state={
            list
        }
        handleList = () => {
           // to do ...
           this.setState({
             list: ...
           })
        }
        return <Com handleList={this.handleList} {...this.props}/>
    }
}
class Com extends Components {
    state = {}
    handleList = () => this.props.handleList()
    
    return (
        ....
    )
}

High-level components operate as ordinary components do

const fn=(Com)=>{
    return class A extends Comonents{
        state={
            list
        }
        return <Com list={this.state.list} {...this.props}/>
    }
}

Menu