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

feat: support clearOnDestroy #692

Merged
merged 15 commits into from
May 13, 2024
Merged

Conversation

crazyair
Copy link
Contributor

@crazyair crazyair commented May 9, 2024

No description provided.

Verified

This commit was signed with the committer’s verified signature.
szokeasaurusrex Daniel Szoke
Copy link

vercel bot commented May 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
field-form ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2024 6:11am

Copy link

codecov bot commented May 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.43%. Comparing base (45c32d5) to head (d2d58ab).

❗ Current head d2d58ab differs from pull request most recent head c949455. Consider uploading reports for the commit c949455 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #692   +/-   ##
=======================================
  Coverage   99.43%   99.43%           
=======================================
  Files          18       18           
  Lines        1247     1249    +2     
  Branches      304      305    +1     
=======================================
+ Hits         1240     1242    +2     
  Misses          7        7           

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

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
crazyair added 2 commits May 9, 2024 17:47

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@@ -165,6 +165,10 @@ export class FormStore {
});

this.prevWithoutPreserves = prevWithoutPreserves;
if (clearStoreOnDestroy) {
// destroy form reset store
this.updateStore({});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不需要回到 initialValues 么?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个 updateStore 就是恢复,反而 setInitialValues 不能恢复,因为
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不太明白,就是有 initialValues,然后我卸载了,在 Mount。这个 store 里没有 initialValues?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clearStoreOnDestroy 的目标是 Form 卸载清空 store,还是恢复 initialValues?

@crazyair crazyair changed the title feat: form destory reset stroe feat: support clearOnDestroy May 10, 2024
@zombieJ zombieJ merged commit ce911e0 into react-component:master May 13, 2024
7 checks passed
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.

None yet

2 participants