随笔分类 -  React

摘要:React Fiber 是 React 16 引入的全新协调算法,与之前的递归栈式架构不同,Fiber 架构显著增强了 React 在性能和灵活性方面的能力。以下是 Fiber 的四个主要优点及其解释: 1. 优先级机制 Fiber 架构引入了任务的优先级调度机制,通过为不同类型的任务分配优先级,R 阅读全文
posted @ 2025-01-23 16:36 Felix_Openmind 阅读(21) 评论(0) 推荐(0) 编辑
摘要:3 assumptions Code is valid JavaScript Test values / properties are defined before acceessing them Code follows Rules of React React Compiler will mos 阅读全文
posted @ 2025-01-04 16:01 Felix_Openmind 阅读(5) 评论(0) 推荐(0) 编辑
摘要:How does React handle updates ? How React Communicates With the Renderer ? the renderer that handles the updates setState calls renderer The Update Wh 阅读全文
posted @ 2025-01-04 15:47 Felix_Openmind 阅读(4) 评论(0) 推荐(0) 编辑
摘要:React hooks allow us to use React features without writing a class state (useState, useReducer) component lifecycle (useEffect) much more(useRef, useC 阅读全文
posted @ 2025-01-04 15:12 Felix_Openmind 阅读(3) 评论(0) 推荐(0) 编辑
摘要:The basic concepts of React reconciliation virtual DOM rendering diffing algorithm pre-knowledge understand the difference between React components, e 阅读全文
posted @ 2025-01-04 13:16 Felix_Openmind 阅读(3) 评论(0) 推荐(0) 编辑
摘要:What is React Fiber? Fiber = {...} Fiber reconciler = current React reconciler based on Fiber (React >= 16) complete rewrite of React that fixed long- 阅读全文
posted @ 2025-01-04 01:09 Felix_Openmind 阅读(8) 评论(0) 推荐(0) 编辑
摘要:* ContactList.js export default function ContactList({ selectedContact, contacts, onSelect }) { return ( <section className="contact-list"> <ul> { con 阅读全文
posted @ 2024-08-04 00:23 Felix_Openmind 阅读(36) 评论(0) 推荐(0) 编辑
摘要:示例图 usePageSizeSelect.js import {useState} from "react"; import Bus from "../../utils/eventBus"; export function usePageSizeSelect() { const onInputKe 阅读全文
posted @ 2024-07-01 14:31 Felix_Openmind 阅读(71) 评论(0) 推荐(0) 编辑
摘要:function A() { return (<> This is A component </>) } function B() { let msg = useContext(MsgContext); return (<> This is B component:::: {msg} </>) } 阅读全文
posted @ 2023-11-05 16:46 Felix_Openmind 阅读(40) 评论(0) 推荐(0) 编辑
摘要:代码案例 function A({ onGetAName }) { const name = `> ${new Date().getTime()} <`; return ( <div> This is A component ! {/*箭头函数形式来调用事件函数*/} <button onClick 阅读全文
posted @ 2023-11-05 16:28 Felix_Openmind 阅读(19) 评论(0) 推荐(0) 编辑
摘要:案例代码 const style = { active: { border: '1px solid red'; } } import {useState} from "react"; const tabs = [ { type: 'hot', text: '最热' }, { type: 'time' 阅读全文
posted @ 2023-10-31 23:30 Felix_Openmind 阅读(42) 评论(0) 推荐(0) 编辑
摘要:React基础 组件内部状态 组件内部状态也称之为局部状态,允许保存、修改和删除存储在组件内部的属性 使用ES6类组件可以在构造函数种初始化组件的状态,构造函数只会在组件初始化的时候调用一次 const list = [ { title: 'React', url: 'https://faceboo 阅读全文
posted @ 2023-10-07 16:08 Felix_Openmind 阅读(14) 评论(0) 推荐(0) 编辑
摘要:In brief > Foundation 1. Communication - Input - Output 2. Event handlers 3. Composition - Using React's children API - Passing a child as a prop - Hi 阅读全文
posted @ 2023-10-06 23:19 Felix_Openmind 阅读(19) 评论(0) 推荐(0) 编辑
摘要:// ★ 最为推荐的一种创建ref的方式: createRef class ClassicalRef extends React.Component { /** * React.createRef调用后可以返回一个容器,这个容器可以存储被ref所标识的节点 * 该容器是专人专用的 * */ node 阅读全文
posted @ 2023-09-15 14:35 Felix_Openmind 阅读(95) 评论(0) 推荐(0) 编辑
摘要:### 组件传值 ``` // 父组件 export default function Tab(props: any) { const [serverUrl, setServerUrl] = useState('https://'); console.log(props); // 父组件接受子组件的 阅读全文
posted @ 2023-09-06 17:12 Felix_Openmind 阅读(12) 评论(0) 推荐(0) 编辑
摘要:import React, { Component } from 'react' import ReactDOM from 'react-dom/client' import { nanoid } from 'nanoid' const root = ReactDOM.createRoot(docu 阅读全文
posted @ 2023-03-22 14:44 Felix_Openmind 阅读(34) 评论(0) 推荐(0) 编辑
摘要:// 导入React、React-DOM // React负责创建React元素 - 虚拟DOM // ReactDOM负责渲染React元素 // JSX - 插值表达式 // 表达式 // 1. 变量 // 2. 基本数据类型:string、number、boolean、undefined、nu 阅读全文
posted @ 2023-03-20 14:01 Felix_Openmind 阅读(18) 评论(0) 推荐(0) 编辑
摘要:import './index.css' import avatar from './images/avatar.png' import React from 'react' import { v4 as uuid } from 'uuid' // 时间格式化 function formatDate 阅读全文
posted @ 2023-03-19 19:22 Felix_Openmind 阅读(13) 评论(0) 推荐(0) 编辑
摘要:nanoid生成唯一ID uuid生成唯一ID nanoid VS uuid 参考连接:https://blog.csdn.net/Cr1556648487/article/details/127012165 阅读全文
posted @ 2023-03-19 18:47 Felix_Openmind 阅读(189) 评论(0) 推荐(0) 编辑

*{cursor: url(https://files-cdn.cnblogs.com/files/morango/fish-cursor.ico),auto;}
点击右上角即可分享
微信分享提示