loader
createBrowserRouter([
{
path: '/',
element: <App/>,
loader: async () => {
return fetch("https://httpbin.org/get")
},
children: [
{
path: 'home',
element: <Home/>,
loader: async () => {
return fetch("https://httpbin.org/get")
},
}
]
}
])params
request
返回响应
抛出异常
延迟数据❓
解决方案✅
为什么加载器返回的响应对象不再起作用?
最后更新于