-
Notifications
You must be signed in to change notification settings - Fork 130
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(components): expose sidebar context #512
Conversation
expose sidebar context that allows it to be used with the useContext hook. This allows the side bar context to be used in a simpler pattern that does not require the render props method of usage.
Codecov Report
@@ Coverage Diff @@
## canary #512 +/- ##
=======================================
Coverage 79.65% 79.65%
=======================================
Files 172 172
Lines 2477 2477
Branches 445 445
=======================================
Hits 1973 1973
Misses 388 388
Partials 116 116
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
🎉 This PR is included in version 1.4.1-canary.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
expose sidebar context that allows it to be used with the useContext hook. This allows the side bar context to be used in a simpler pattern that does not require the render props method of usage.
Purpose
Expose sidebar context that allows it to be used with the useContext hook.
Currently the sideBar context is accessed using the render props method like so.
This method of accessing was necessary in the past, however with the availability of the useContext hook it makes things a lot more simpler and elegant.
Approach and changes
With this PR, we also enable consuming the context with the useContext hook, however we still support the older render props access method so we don't break things.
Definition of done