Application of methods to obtain data from other components in React
P粉449281068
P粉449281068 2023-09-03 18:00:40
0
1
249
<p>I have a constant that receives a json data through fetch. The code is as follows: </p> <p><code>const [user, setUser] = useState([]);</code></p> <p><code> Asynchronous function users() { const result = wait fetch (</code>My API `,{ })</p> <pre class="brush:php;toolbar:false;">const data = await result.json(); setUser(data);`</pre> <p>I want to display her data in another component, like only name or only ID. </p> <p>I want to put the name in this little blue block: this is another component</p> <p>More about the second component</p>
P粉449281068
P粉449281068

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!