lundi 1 janvier 2018

Passing props to higher-order components

Lets say if we have the following HOC:

const myHoc = someProps => ComposedComponent => {
  const propsToPass = { /* ...some calculations... */ }; 
  return <ComposedComponent {...propsToPass} />;
};

How would I pass a prop to ComposedComponent in myHoc outside of myHoc?

Aucun commentaire:

Enregistrer un commentaire