这个为啥报错呀
import type { RouteObject } from 'react-router-dom'
import Home from '@/pages/home'
const routes: RouteObject[] = [
{
path: '/',
element: <Home />
}
]
export default routes
✘ [ERROR] Expected ">" but found "/"
src/router/routes.ts:8:19: 8 │ element: <Home /> │ ^ ╵ >
Build failed with 1 error: src/router/routes.ts:8:19: ERROR: Expected ">" but found "/"
1
anonymous2351d00 2023-02-26 23:39:28 +08:00
要不要试试引入一下
import React from 'react'; |
2
xiaoweipeng OP 试过了,不行
|
3
xiaoweipeng OP @anonymous2351d00 试过了,不行
|
4
gausszhou 2023-02-27 01:02:45 +08:00
空格啊
|
5
ruoxie 2023-02-27 01:09:08 +08:00 via iPhone
element: Home
|
6
des 2023-02-27 01:35:07 +08:00
你需要将文件名从 ts 改名为 tsx
|
7
IvanLi127 2023-02-27 01:48:53 +08:00 via Android
楼上正解,文件名不对
|
8
xiaoweipeng OP @des 可以,感谢大佬
|