1.react包
//useEffect:副作用函数,
//useState:给函数组件提供状态
import {
React,
useEffect,
useState,
useRef
} from 'react'
2.react-dom
//渲染dom
import ReactDOM from 'react-dom'
3.redux
// 1.创建store的方法和中间件的方法
import { createStore, applyMiddleware } from 'redux'
4.react-redux
/*
Provider:在根组件让所有组件共享store或其他数据
useDispatch:组件调用dispatch需要useDispatch来创建
useSelector:组件获取redux的状态
*/
import {
Provider,
useDispatch
} from 'react-redux'
5.react-router
/*
Redirect:路由重定向
Route :路由规则进行配置
useHistory:创建history,可以用来组件跳转
*/
import {
Redirect,
Route,
useHistory
} from 'react-router'
6.react-router-dom
// 这些一般都是创建路由时需要用到
import {
BrowserRouter,
HashRouter
Router,
Route,
Switch,
Redirect
} from 'react-router-dom'