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: useStorageState setStoreValue catch this error to the developer #2123

Merged
merged 6 commits into from Mar 28, 2023

Conversation

51wangping
Copy link
Contributor

@51wangping 51wangping commented Mar 16, 2023

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

close: #2100

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English The setStoreValue error of useLocalStorageState and useSessionStorageState can be captured by the developer using try/catch
🇨🇳 Chinese useLocalStorageState 和 useSessionStorageState 的 setStoreValue 错误开发者可以使用 try/catch 进行捕获

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@CLAassistant
Copy link

CLAassistant commented Mar 16, 2023

CLA assistant check
All committers have signed the CLA.

@liuyib liuyib self-requested a review March 17, 2023 08:28
@liuyib
Copy link
Collaborator

liuyib commented Mar 20, 2023

This not a better way to resolve #2100. You known, we can't try...catch a hook in React, so I suggest to use a callback (e.g. onError, refer: #L107) @51wangping

@51wangping
Copy link
Contributor Author

This not a better way to resolve #2100. You known, we can't try...catch a hook in React, so I suggest to use a callback (e.g. onError, refer: #L107) @51wangping

Changed

@crazylxr
Copy link
Collaborator

冲突解决一下,代码应该没啥问题了

1 similar comment
@crazylxr
Copy link
Collaborator

冲突解决一下,代码应该没啥问题了

@liuyib
Copy link
Collaborator

liuyib commented Mar 23, 2023

冲突解决一下,代码应该没啥问题了

done

@crazylxr crazylxr merged commit d5fd82c into alibaba:master Mar 28, 2023
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.

feat: useSessionStorageState throwing an exception with an error
4 participants