react
react
『九离~空白』
When you are strong enough, the whole world will be kind to you.Work hard to learn new techniques so that you can achieve your dreams and go further.
展开
-
React-Router 的使用总结 ?
什么是 React-Router ?React-Router:基于React之上的强大的路由库,用于页面不同模块跳转。React-Router 的安装 ? 使用create-react-app初始化项目。 运行npminstall--savereact-router命令,安装React-Router-dom 。 React-Router 的基本使用 ? 【完整代码链接】import React, { Component } from 'reac...原创 2020-11-26 15:15:44 · 120 阅读 · 0 评论 -
React 中组件间实现通信 ?(包含 Redux)
前言:随着前端三大主流框架(Vue,React,Angular)的应用,我们应该意识到它们都有一个相同的思想,就是组件化的思想。我们先思考几个问题,组件化有什么好处 :可以增强代码模块的复用性。同时也可以提高开发效率,后期便于项目版本升级和维护。什么是组件化的思想呢 :按照我自己的理解,一个页面划分为不同的小模块,每一个模块代表一个组件,分开独立去开发各个组件模块,之后在嵌套一起,形成最终的展示页面。这里体现了页面拆分,独立的组件是指完全不影响,没有交互吗 ?前两个问题已经给出了答案,现在..原创 2020-11-12 15:31:20 · 381 阅读 · 0 评论 -
说说 React 的生命周期,它和 Vue 的生命周期有什么区别 ?
前言:首先,无论是 Vue 还是 React 都有生命周期的概念,都提供了一系列的生命周期函数(钩子函数)。 生命周期:它指的是组件从初始化开始到结束的过程,每个组件都具有生命周期,都对组件通过生命周期给予的钩子函数进行管理。 钩子函数:它指的是系统某些状态和参数发生改变的时候,系统立马去通知对应处理的函数。React 生命周期:Initialization:初始化阶段getDefaultProps ( 取得默认属性(高版本移除)) getInitialState( 初始化...原创 2020-11-06 11:14:56 · 1059 阅读 · 0 评论 -
对于 React 中 JSX 的一些理解 ?
前言:当我们从类似 jQuery 操作 DOM 的框架,步入以数据操作界面元素的React 框架时,我们需要对它内部的JSX 有所掌握。它作为 React 框架的特性之一,本身并不复杂,只是细微的语法需要熟练和注意。首先我们得清除 JSX 语法为何出现 ?我们知道,传统的操作 DOM 类型的框架转换成以数据操作界面的框架。核心变化在于虚拟DOM的出现,Vue 和 React 都是如此,那么在 React 中是怎么构建虚拟 DOM 元素的,这就要用到 JSX。什么是 JSX ?JSX:它是..原创 2020-11-05 11:08:49 · 147 阅读 · 0 评论