1.vite
npm create vite@latest my-app --template react-swc-ts
2.antd
npm install antd --save
npm install react-router-dom localforage match-sorter sort-by
// src/main.tsx
import React from 'react'
import ReactDOM from 'react-dom/client'
import { RouterProvider } from 'react-router-dom'
import './index.css'
import router from './router/index.tsx'
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>
<RouterProvider router={router} />
</React.StrictMode>
)
// src/router/index.tsx
import { createBrowserRouter } from 'react-router-dom'
import App from '../App.tsx'
const router = createBrowserRouter([
{
path: '/',
element: <App></App>,
children: []
}
])
export default router