我正在嘗試在我的 rails / react 應用程式中使用 redux 和 hooks 并遇到一個奇怪的問題。當我第一次控制臺記錄正在獲取的串列物件時,它們在控制臺中顯示正常并正確呈現

[]lists{[]}lists
這是使用 DOM 的條件渲染來重現您所遇到的錯誤并毫無例外地處理它的沙箱:
Sandbox
Sample code to check if the type is array with useEffect():
useEffect(() => {
console.log("is array type? : ", Array.isArray(lists));
}, [lists]);
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/441497.html
