ReactJs / Javascript - Can a HOC read the parameter component's props? -


i have higher order component receives component parameter:

hoc

export default function hoc(comp) {   return class extends component {    dosomething() {     const temp = // comp's clientid prop???   }   ........   } }    

sub component

@hoc export default class subcomponent extends component {       .....       static proptypes = {   clientid: proptypes.string.isrequired  };  .......     } 

question:

is possible in scenario above hoc aware of subcomponent's clientid property in arguements , if so, how can make hoc aware of dosomething function?

since it's hoc receives props (or rather component function returns), can access them this.props:

const temp = this.props.clientid; 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -