Skip to content

Instantly share code, notes, and snippets.

@Clarity-89
Created September 15, 2022 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Clarity-89/ea3ac12ca1fca09324e8cd0f3920b11b to your computer and use it in GitHub Desktop.
Save Clarity-89/ea3ac12ca1fca09324e8cd0f3920b11b to your computer and use it in GitHub Desktop.
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