update the state to be ['one', 'two', 'three','four', 'five', 'six']
one way would be setData([...data, ...newData]) I dont know how you are updating your local state
then also make sure to keep the pagination number so you fet the items from the last item that was fetched so if you fetched 5 items the next place to bring items in from would be from 6 - 10
2条答案
按热度按时间fnvucqvd1#
从RTK版本1.9开始,您现在可以使用
merge
选项进行此类操作。要了解更多信息,您可以查看我对another question的回答。
cbjzeqam2#
我们的目标是取['一','二','三']
使用已提取的数据[“four”,“five”,“six”]运行提取和