-
-
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
Make SaveContext provides access to side effects #5604
Conversation
This PR should probably target |
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.
Yes, this should target next
. Besides, the linter has some remarks about missing dependencies in your useEffect
calls in tests.
@@ -24,7 +27,7 @@ interface SaveContextValue extends SideEffectContextValue { | |||
saving?: boolean; | |||
} | |||
|
|||
export const SaveContext = createContext<SaveContextValue>({}); | |||
export const SaveContext = createContext<SaveContextValue>(undefined); |
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.
I'm surprised TypeScript doesn't complain about the default context value. The type should be SaveContextValue?
I think.
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.
I was surprised as well but yet it doesn't complain about it
0b0ac01
to
e465de7
Compare
No description provided.