The State Changers discussed a problem with pagination on WeWeb editor. They are loading data by calling data on page load to get the first twenty-five, followed by incrementing the page by one and calling the same request. To add more data, they're using a 'load more action'.
The issue arises when they try to add subsequent page data to the current list. The current system creates a nested array, whereas the goal is to add each set of twenty five as new, separate items to the existing array. After reviewing the steps in the current workflow, they proposed a solution using a 'spread operator'. This recreates the list, maintains existing data, and then adds new items from the new page. This process flattens the array, thereby avoiding the creation of a nested array. Upon testing, the solution seemed to work well. The speaker noted that though an easier way to perform the operation would be provided, the solution they proposed is a standard practice for React or Vue apps. This workaround could be repeated for additional pages. No other keywords were significantly mentioned in the meeting.
(Source: Office Hours 7/6/23 )
Join State Change Risk-Free