03 2021 档案

摘要:官网:https://zh-hans.reactjs.org/docs/hooks-state.html#gatsby-focus-wrapper Hook 是什么? Hook 是 React 16.8 的新增特性。它可以让你在不编写 class 的情况下使用 state 以及其他的 React 特 阅读全文
posted @ 2021-03-25 15:32 惊蛰丶 阅读(128) 评论(0) 推荐(0)
摘要:官网:https://www.reduxjs.cn/ Redux 是针对 JavaScript 应用程序的可预测状态容器。 解决项目数据管理、组件通信,用于数据和交互较多的应用 一、安装 cnpm install redux --save 二、创建Store Store 就是用来维持应用所有的 st 阅读全文
posted @ 2021-03-11 15:06 惊蛰丶 阅读(200) 评论(0) 推荐(0)
摘要:官网:https://reactrouter.com/web/guides/quick-start 一、安装 cnpm i react-router-dom -S 二、引入 hash模式 // 使用<Router>包裹组件 import { HashRouter as Router } from ' 阅读全文
posted @ 2021-03-10 16:51 惊蛰丶 阅读(617) 评论(0) 推荐(0)
摘要:官网:https://zh-hans.reactjs.org/ 一、创建项目 (第一行的 npx 不是拼写错误 —— 它是 npm 5.2+ 附带的 package 运行工具) npx create-react-app my-app cd my-app npm start 二、文件结构 node_m 阅读全文
posted @ 2021-03-08 17:09 惊蛰丶 阅读(205) 评论(0) 推荐(0)