Fix context#925
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough本次变更主要修改了 Changes
Sequence Diagram(s)sequenceDiagram
participant T as 测试用例
participant Tree as 树组件
participant Node as TreeNode
participant Ctx as UnstableContext
T->>Tree: 初始渲染 (nodeDisabled = false)
Tree->>Node: 根据 context 与 props 计算 isDisabled
Node->>Tree: 渲染启用状态节点
T->>Ctx: 修改 nodeDisabled 为 true
T->>Tree: 重新渲染组件
Tree->>Node: 重新计算 isDisabled (更新后的 context)
Node->>Tree: 渲染禁用状态节点 (添加 rc-tree-treenode-disabled 类)
Possibly related PRs
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
src/TreeNode.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-react". (The package "eslint-plugin-react" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following: The plugin "eslint-plugin-react" was referenced from the config file in ".eslintrc.js » /node_modules/.pnpm/@umijs+fabric@4.0.1_jest@29.7.0_@types+node@22.13.5__postcss@8.5.3/node_modules/@umijs/fabric/dist/eslint.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. tests/Tree.spec.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-react". (The package "eslint-plugin-react" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following: The plugin "eslint-plugin-react" was referenced from the config file in ".eslintrc.js » /node_modules/.pnpm/@umijs+fabric@4.0.1_jest@29.7.0_@types+node@22.13.5__postcss@8.5.3/node_modules/@umijs/fabric/dist/eslint.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🔇 Additional comments (2)
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #925 +/- ##
==========================================
- Coverage 99.84% 99.84% -0.01%
==========================================
Files 14 14
Lines 1275 1274 -1
Branches 383 389 +6
==========================================
- Hits 1273 1272 -1
Misses 2 2 ☔ View full report in Codecov by Sentry. |
在 #905 CC -> FC 的重构把
isDisabled用useMemo包了起来。导致 UnstableContext 提供的闭包 disabled 切换会被 memo 掉。去掉了
useMemo还原为 CC 等效逻辑。Summary by CodeRabbit