Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react): fix field unmounted but can not update right model #3994

Merged
merged 6 commits into from
Oct 18, 2023

Conversation

janryWang
Copy link
Collaborator

Before submitting a pull request, please make sure the following is done...

  • Ensure the pull request title and commit message follow the Commit Specific in English.
  • Fork the repo and create your branch from master or formily_next.
  • If you've added code that should be tested, add tests!
  • If you've changed APIs, update the documentation.
  • Ensure the test suite passes (npm test).
  • Make sure your code lints (npm run lint) - we've done our best to make sure these rules match our internal linting guidelines.

Please do not delete the above content


What have you changed?

当初为了修复 #3284 这个问题的原因主要是 StrictMode 场景下,form 组件被卸载,导致很多响应器被销毁,所以优化了一下 useAttach 逻辑,但这里的副作用是 useAttach 内部存在异步逻辑,对于 field 内部的渲染场景,会触发时序问题,还是得用最原始的 useEffect 实现才行

Fixed #3941

@github-actions
Copy link
Contributor

github-actions bot commented Oct 17, 2023

Size Change: +76 B (0%)

Total Size: 516 kB

Filename Size Change
packages/react/dist/formily.react.umd.development.js 6.55 kB +40 B (+1%)
packages/react/dist/formily.react.umd.production.js 3.91 kB +36 B (+1%)
ℹ️ View Unchanged
Filename Size
packages/antd/dist/formily.antd.umd.development.js 86 kB
packages/antd/dist/formily.antd.umd.production.js 47.4 kB
packages/core/dist/formily.core.umd.development.js 20.6 kB
packages/core/dist/formily.core.umd.production.js 13.3 kB
packages/element/dist/formily.element.umd.development.js 63 kB
packages/element/dist/formily.element.umd.production.js 35.9 kB
packages/grid/dist/formily.grid.umd.development.js 9.13 kB
packages/grid/dist/formily.grid.umd.production.js 5.67 kB
packages/json-schema/dist/formily.json-schema.umd.development.js 7.21 kB
packages/json-schema/dist/formily.json-schema.umd.production.js 4.58 kB
packages/next/dist/formily.next.umd.development.js 78.7 kB
packages/next/dist/formily.next.umd.production.js 45.2 kB
packages/path/dist/formily.path.umd.development.js 11.3 kB
packages/path/dist/formily.path.umd.production.js 7.27 kB
packages/reactive-react/dist/formily.reactive-react.umd.development.js 4.28 kB
packages/reactive-react/dist/formily.reactive-react.umd.production.js 2.03 kB
packages/reactive-vue/dist/formily.reactive-vue.umd.development.js 3.11 kB
packages/reactive-vue/dist/formily.reactive-vue.umd.production.js 1.34 kB
packages/reactive/dist/formily.reactive.umd.development.js 9.68 kB
packages/reactive/dist/formily.reactive.umd.production.js 5.43 kB
packages/shared/dist/formily.shared.umd.development.js 8.05 kB
packages/shared/dist/formily.shared.umd.production.js 4.09 kB
packages/validator/dist/formily.validator.umd.development.js 8.56 kB
packages/validator/dist/formily.validator.umd.production.js 5.84 kB
packages/vue/dist/formily.vue.umd.development.js 11.1 kB
packages/vue/dist/formily.vue.umd.production.js 6.38 kB

compressed-size-action

@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (2fc23dd) 99.55% compared to head (e892102) 99.55%.
Report is 2 commits behind head on formily_next.

Additional details and impacted files
@@              Coverage Diff              @@
##           formily_next    #3994   +/-   ##
=============================================
  Coverage         99.55%   99.55%           
=============================================
  Files               152      152           
  Lines              6709     6714    +5     
  Branches           1817     1820    +3     
=============================================
+ Hits               6679     6684    +5     
  Misses               30       30           
Files Coverage Δ
packages/core/src/models/Query.ts 100.00% <100.00%> (ø)
packages/react/src/components/Field.tsx 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@janryWang janryWang merged commit 5207021 into formily_next Oct 18, 2023
7 checks passed
@janryWang janryWang deleted the fix_field_unmount_can_not_set_right_value branch October 18, 2023 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report] Incorrect mounted Property State in Array Items After Removal
1 participant