index.tsx 1.1 KB
import React from 'react'
import ReactDOM from 'react-dom/client'
import 'normalize.css'
import '@/assets/css/index.less'
import { Provider } from 'react-redux'
import { HashRouter } from 'react-router-dom'
import App from '@/App'
import store from './store'

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)
root.render(
  <Provider store={store}>
    <HashRouter>
      <App />
    </HashRouter>
  </Provider>
)

// react-tsx 360

// craco => create-react-app-config 配置@别名 用于配置的运行config 需要修改package (npm install @craco/craco@alpha -D)
/*
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
            ↓替换为
    "start": "craco start",
    "build": "craco build",
    "test": "craco test",
*/
// npm install normalize.css => 全局重置样式
// npm install craco-less => 配置 craco.config.js 来使用less
// npm install react-router-dom => react 路由
// npm install @reduxjs/toolkit react-redux => 状态管理工具
// npm install styled-components -D => 写样式