Use a very simple example to understand the idea of react.js high-order components

一个新手
Release: 2017-10-06 10:42:15
Original
1449 people have browsed it

Before debugging the code, I set up two caches

They are username and content

set in the console Two cache codes

localStorage.setItem('username','老王') localStorage.setItem('content','类容')
Copy after login

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)=>=    

111

let LocalInput=local(Input,'username'=local(Textareas,'content'=

类容

,document.querySelector("#root"))
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!