Created
September 15, 2022 14:45
-
-
Save Clarity-89/ea3ac12ca1fca09324e8cd0f3920b11b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const ListPage = () => { | |
const [items, setItems] = useState([]); | |
useEffect(() => { | |
const loadItems = async () => { | |
setTimeout(() => setItems(["Item 1", "Item 2"]), 100); | |
}; | |
loadItems(); | |
}, []); | |
if (!items.length) { | |
return <div>Loading...</div>; | |
} | |
return ( | |
<div className="text-list__container"> | |
<h1>List of items</h1> | |
<ItemList items={items} /> | |
</div> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment