# React_basic **Repository Path**: new_tk/react_basic ## Basic Information - **Project Name**: React_basic - **Description**: 学习React - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-02-26 - **Last Updated**: 2025-02-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 安装插件 nanoid (用于生成id) `js npm install nanoid ` # 引入插件 ![alt text](image.png) # 安装 axios `js npm install axios ` # 安装插件 pubsub-js `js npm i pubsub-js `
 
```
  // pubsub-js用法:
  // 1.引入 pubsub-js
  import PubSub from 'pubsub-js'

  // 2.订阅消息
  PubSub.subscribe('xxx', (msg, data) => {
    console.log(msg, data)
  })

  // 3.发布消息
  PubSub.publish('xxx', 'hello world')

  // 4.取消订阅
  PubSub.unsubscribe('xxx')

 ```
# 安装插件 react-router-dom `js npm i react-router-dom@5 ` ## 路由 ![alt text](image-1.png) ![alt text](image-2.png) ![alt text](image-7.png) ![alt text](image-6.png) ![alt text](image-5.png) ![alt text](image-4.png) ![alt text](image-3.png) ![alt text](image-8.png) ![alt text](image-9.png) ![alt text](image-10.png) ![alt text](image-11.png) # 安装插件 - querystring `js npm i query-string -S ` # 安装插件 - Ant Design( antd ) `js npm i antd -S ` # 安装插件 - redux@3.7.2 `js npm i redux@3 -S `