![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
react
文章平均质量分 93
Abudula__
深圳大学计软学生
展开
-
A brief introduction to React Context
What is itContext is introduced by react to handle cases like this . When you need some data ,some certain state,but you do not want to pass through multiple layers of components just to get it from A at the top to component D at the very bottom where原创 2021-06-28 01:42:17 · 202 阅读 · 0 评论 -
High Order Component(HOC) 高阶组件
根据reactJs官方文档的定义,HOC如下:简要来讲的话,是一种重复利用组件逻辑的技术,接受一个组件,并且返回一个组件。就上上面的例子一样,会接受WrappedComponent然后返回enhancedComponent.下面举例子来讲解。1.创建一个按钮组件,并且监听点击次数import React, { Component, useState, useEffect } from ...原创 2020-03-22 15:56:59 · 625 阅读 · 0 评论