首页/ AI 技能 / @skilllib/skill-2014279404933820418
Skill站外收录 @skilllib/skill-2014279404933820418

tooling

提供 React 应用的深度调试与性能优化能力,涵盖组件重渲染追踪、自定义 Hook 状态标记、打包体积分析、开发期严格模式校验及无效渲染检测,支撑高效开发与问题定位。

0.0 (0) 549 次安装 原作者 编程导航
收录于 2026-01-22

Skills.MD

# React Tooling ## **Priority: P2 (OPTIONAL)** Tools for analysis and debugging. ## Implementation Guidelines - **DevTools**: Use "Highlight Updates" to spot re-renders. - **Debugger**: `useDebugValue` for custom hooks. - **Performance**: `why-did-you-render` to catch wasted renders. - **Bundle**: `source-map-explorer` or `bundle-visualizer`. - **Linting**: `eslint-plugin-react-hooks` (Errors) + `react-refresh`. - **Strict Mode**: Enable for double-invoke checks (effects/reducers). ## Code ```tsx // Debugging Hooks useDebugValue(isOnline ? 'Online' : 'Offline'); // why-did-you-render if (process.env.NODE_ENV === 'development') { const whyDidYouRender = require('@welldone-software/why-did-you-render'); whyDidYouRender(React, { trackAllPureComponents: true, }); } ```

评论 0

还没有评论,来抢沙发。