Skip to content

kiritoxjf/template-react-ts

Repository files navigation

【个人用】React模板仓库

构建记录

npm create vite@latest my-app --template react-swc-ts
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

About

个人react模版项目

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published