A higher-order component is a function that takes a component and returns a new component

  const foo=(Cmp) = >(props) = >{
    return (
      <div>
         <Cmp {. props} >
      </div>
    )
  function Child(props){
    return <div>{props.name}</div>
    }
    const Foo=foo(Child)
  }

Copy the code

Higher-order components should not be written into Render