while(alive) { learn(); }
知识记录
作用:允许组件使用ref将一个DOM节点暴露给父组件 jsx import { forwardRef, useRef } from 'react' const MyInput = forwardRef
2024 年 1 月 12 日
顾名思义,Class API就是使用ES6支持的原生Class API来编写React组件 通过一个简单的 Counter 自增组件看一下组件的基础编写结构 jsx // class API impo
2024 年 1 月 12 日
Zustand Documentation javascript import { create } from 'zustand' const useStore = create((set) = {
2024 年 1 月 12 日
简单场景下,可以使用TS的自动推断机制,不用特殊编写类型注解,运行良好 typescript const [val, toggle] = React.useState(false) // val 会被
2024 年 1 月 12 日
props作为React组件的参数入口,添加了类型之后可以限制参数输入以及在使用props有良好的类型提示 tsx interface Props { className: string } expo
2024 年 1 月 12 日
输入关键词开始搜索