Home >Web Front-end >JS Tutorial >Use a very simple example to understand the idea of react.js high-order components
localStorage.setItem('username','老王') localStorage.setItem('content','类容')
Be sure to set these two caches before running the following code, because I encapsulated the public method in the high-order component and called the cache to the value of the input box
, the component returned by the higher-order component calls this method
'react''react-dom'.state={data:''==(event)=>= <Comp handBlur={.handBlur} data={.state.data}/> <input type="text" defaultValue={props.data} onBlur={props.handBlur}/> <textarea defaultValue={props.data}></textarea> <p>111</p>let LocalInput=local(Input,'username'=local(Textareas,'content'=<p> <form><LocalInput/> 类容 <LocalTextareas/> <Localp></Localp> </form> </p><From></From>,document.querySelector("#root"))
The above is the detailed content of Use a very simple example to understand the idea of react.js high-order components. For more information, please follow other related articles on the PHP Chinese website!