-
Notifications
You must be signed in to change notification settings - Fork 99
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
docs(useDefault): Suggest useMediatedState
instead
#562
Conversation
17834aa
to
93b1b47
Compare
TBH i dont think we need that hook since it is easily (and versatile) achievable via @JoeDuncko WDYT? |
I wonder if we should have a cookbook of common hooks that can be easily derived from our hooks, or something like that. Maybe as examples in Storybook? I know that doesn't exactly answer the question though. |
I've been thinking about that too (cookbook). Maybe separte page near migration and reference in mugration like |
Yeah a cookbook sounds good, do you want me to create such a page? Or would you prefer doing it? |
Sorry for the slow reply. If you know your way around Storybook, go for it! I'm still new to Storybook, so I'd have to figure out the best way to present alternative examples. Ideas welcome. |
93b1b47
to
9311a17
Compare
Apologies for leaving this for so long, life kind of got in the way and this got away from me. Please check if the documentation suggestion is correct. |
useDefault
from react-use
useMediatedState
instead
LGTM, merging after all check passed. |
Codecov Report
@@ Coverage Diff @@
## master #562 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 50 50
Lines 865 865
Branches 162 162
=========================================
Hits 865 865 Continue to review full report at Codecov.
|
🎉 This PR is included in version 13.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What new hook does?
It works like
useSafeState
, except it will return the provided default value when the state is set toundefined
ornull
.Checklist
react-use
#33