Frontend Development
React: Solution for not Refreshing the Page after setState an Array
Problem Description: const [data, setData] = useState([]); data.push(1); setData(data); When I modify the origin array data and set it back, the page won’t refresh. Analysis: In vue and react, if you update a mutable object, it will cause the view to be updated. However, vue and react use shallow listening Read more…