-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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 usePreference
should throw an error when used outside a <Configurable>
context
#9537
Conversation
@@ -218,3 +218,8 @@ export const I18n = () => { | |||
}; | |||
|
|||
export const NotInContext = () => <TextBlock />; | |||
|
|||
export const usePreferenceNotInConfigurable = () => { |
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.
export const usePreferenceNotInConfigurable = () => { | |
export const UsePreferenceOutsideConfigurable = () => { |
docs/Configurable.md
Outdated
@@ -58,7 +58,7 @@ const TextBlockEditor = () => { | |||
); | |||
}; | |||
``` | |||
This hook is only used within a Configurable component. |
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 line is redundant with the information given above. IMO it's not necessary to add it.
@@ -218,3 +218,8 @@ export const I18n = () => { | |||
}; | |||
|
|||
export const NotInContext = () => <TextBlock />; | |||
|
|||
export const usePreferenceNotInConfigurable = () => { |
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.
export const usePreferenceNotInConfigurable = () => { | |
export const UsePreferenceNotInConfigurable = () => { |
Not sure it's necessary to create a story for this corner-case though...
5563c60
to
bf44785
Compare
usePreference
should throw an error when used outside a <Configurable>
context
Resolve #9526