JavaScript/react:修订间差异
来自康健生活
| 第175行: | 第175行: | ||
at unstable_runWithPriority (webpack:///./node_modules/scheduler/cjs/scheduler.development.js?:653:12) | at unstable_runWithPriority (webpack:///./node_modules/scheduler/cjs/scheduler.development.js?:653:12) | ||
at runWithPriority$1 (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:11039:10)</syntaxhighlight> | at runWithPriority$1 (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:11039:10)</syntaxhighlight> | ||
: 抛这个错误的场景是我在做一个列表拖拽排序的功能 | |||
[[文件:画板拖拽排序 1.gif|400px|画板拖拽排序 1.gif]] | |||
2022年4月2日 (六) 04:19的版本
引言
方法
| React.FC | useEffect | React.StrictMode |
| useRef | 示例 | 示例 |
| 示例 | 示例 | 示例 |
关键字
| ref | 路由 | store |
| 示例 | 示例 | 示例 |
| 示例 | 示例 | 示例 |
脚手架
| umi | 示例 | 示例 |
结构
| 数组 | 示例 | 示例 |
| 示例 | 示例 | 示例 |
| 示例 | 示例 | 示例 |
Component
| displayName | 示例 | 示例 |
| 示例 | 示例 | 示例 |
| 示例 | 示例 | 示例 |
组件设计
| 函数式声明组件 |
| modal | 示例 | 示例 |
| 示例 | 示例 | 示例 |
| 示例 | 示例 | 示例 |
| shouldComponentUpdate | pureComponent |
函数
| dangerouslySetInnerHTML | 示例 | 示例 |
| 示例 | 示例 | 示例 |
| 示例 | 示例 | 示例 |
高阶函数
| 高阶函数 | 示例 | 示例 |
| 示例 | 示例 | 示例 |
| 示例 | 示例 | 示例 |
事件
| React.RefObject | React.EventHandler | React.MouseEvent | React.TouchEvent |
| React.forwardRef | React.FunctionComponent | React.MouseEventHandler | |
| 示例 | 示例 | 示例 |
事件处理
| onChange | onClick | event.persist |
| SyntheticEvent | 示例 | 示例 |
| 示例 | 示例 | 示例 |
事件相关
| 事件冒泡 | 示例 | 示例 |
| 示例 | 示例 | 示例 |
| 示例 | 示例 | 示例 |
CSS
hooks
| useCallback | useState | useRef |
| useContext | useReducer | useMemo |
| useEffect | useLayoutEffect |
颗粒
基础颗粒
场景颗粒
算法
| reconciliation | 示例 | 示例 |
| 示例 | 示例 | 示例 |
| 示例 | 示例 | 示例 |
其他
| 自定义参数 | 示例 | 示例 |
| 示例 | 示例 | 示例 |
| 示例 | 示例 | 示例 |
参考
- https://reactjs.org/docs/events.html#mouse-events
- https://fettblog.eu/typescript-react/events/
- https://docs.microsoft.com/en-us/javascript/api/office-ui-fabric-react/positioningcontainer?view=office-ui-fabric-react-latest
- https://reactjs.org/docs/handling-events.html
其他
| class | 元素显示隐藏 | 示例 |
| 示例 | 示例 | 示例 |
| 示例 | 示例 | 示例 |
error
- Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.
- Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanu.
- Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
- react-dom.development.js:7601 Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
react-dom.development.js:7601 Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. at removeChild (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:7601:18) at unmountHostComponents (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:20449:9) at commitDeletion (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:20500:5) at commitMutationEffects (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:22782:11) at HTMLUnknownElement.callCallback (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:188:14) at Object.invokeGuardedCallbackDev (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:237:16) at invokeGuardedCallback (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:292:31) at commitRootImpl (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:22509:9) at unstable_runWithPriority (webpack:///./node_modules/scheduler/cjs/scheduler.development.js?:653:12) at runWithPriority$1 (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:11039:10)
- 抛这个错误的场景是我在做一个列表拖拽排序的功能
No categories