with a null value by default resulting in an "empty" page. 報錯問題" type="hidden"/>

【React】react:Matched leaf route at location "/" does not have an element. This means it will render an with a null value by default resulting in an "empty" page. 報錯問題


問題原因

image

Matched leaf route at location "/" does not have an element. This means it will render an with a null value by default resulting in an "empty" page.
位置“/”匹配的葉路由沒有元素。這意味着它將渲染<Outlet />默認值為空會導致“空”頁。

應該是最新 raect-router-dom 改變了書寫方式,我看的是去年的教程視頻,所以導致寫法過時報警告了。

解決方式

image


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM