随笔分类 -  React

摘要:import React, { Component, useContext, useState } from 'react'; // 解构写法 const { Provider, Consumer } = React.createContext(); // defaultValue的问题 // ht 阅读全文
posted @ 2021-04-07 17:10 韭菜茄子 阅读(72) 评论(0) 推荐(0) 编辑
摘要:// 函数组件使用forwardRef传递ref const ForwardRefComponent = React.forwardRef((props, ref) => <div ref={ref.bind(this)} {...props}>子组件DOM</div>) export defaul 阅读全文
posted @ 2021-04-02 17:35 韭菜茄子 阅读(1575) 评论(0) 推荐(0) 编辑
摘要:React 通过ref获取DOM对象或者子组件实例的用法 https://www.cnblogs.com/greatdesert/p/12697726.html React 通过forwardRef获取函数组件内某个DOM节点或者子组件的实例 https://www.cnblogs.com/grea 阅读全文
posted @ 2021-04-01 16:58 韭菜茄子 阅读(179) 评论(0) 推荐(0) 编辑
摘要:section 1 //react组件 export class Halo extends React.Component{ constructor(...args){ super(...args); //初始化父类构造函数 this.state={ //设置state text:"" } } he 阅读全文
posted @ 2017-12-06 20:57 韭菜茄子 阅读(166) 评论(0) 推荐(0) 编辑
摘要:https://itbilu.com/javascript/react/4k5RfzDKx.html 阅读全文
posted @ 2017-06-11 12:21 韭菜茄子 阅读(182) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示