Load More Button
Hard · Async
The helper fakeFetchPage(page) returns a Promise that resolves after 80ms with { items, hasMore }. Pages hold 3 items and there are 7 items in total.
Load page 1 when the component mounts. Render the loaded items as <li> inside a <ul> and a "Load more" button that loads the next page and APPENDS its items.
- While a page is loading, show <p className="loading">Loading...</p> and make the button disabled.
- When hasMore is false, remove the button and show <p className="end">No more items</p> instead.