Nasze zasady domu
`useEffect` must be a **synchronous** function that returns either a cleanup function or nothing. If you need to run an async operation you should do it **inside** the effect, not make the effect itself `async`. ```tsx import { useEffect, useState } from 'react'; function MyComponent() { const [data, setData] = useState(null); useEffect(() => { // async work is done inside the effect const fetchData = async () => { const result = await fetchSomeData(); setData(result); }; fetchData(); // optional cleanup return () => { // e.g. cancel a subscription or abort a fetch }; }, []); // dependencies returnQuesto è il nostro sito web e offriamo sempre i prezzi più convenienti qui. Clicca qui per i nostri alloggi o inviaci una domanda personale. oppure inviaci una domanda personale. oppure continua con Odwiedź hiszpańskie miasto Sewilla , Faraon oppure vai alla panoramica di tutti gli articoli.