-
-
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
[TypeScript] Make types more strict in ra-core #9741
Conversation
@@ -1,6 +1,6 @@ | |||
import { createContext, useContext } from 'react'; | |||
|
|||
export const HasDashboardContext = createContext<boolean>(undefined); | |||
export const HasDashboardContext = createContext<boolean>(false); |
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.
Shouldn't you change the type instead and make useHasDashboard
fail loudly (https://blog.codeminer42.com/you-are-using-react-context-wrong/)?
onSuccess?: ( | ||
data: RecordType | undefined, | ||
variables: Partial<UseDeleteMutateParams<RecordType>>, | ||
context: unknown | ||
) => void; |
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 don't get this one. Doesn't UseMutationOptions
already include onSuccess
?
With strictNullChecks turned on, this PR reduces TS compilation errors on ra-core from 246 to 180 (-26%).
Refs #9622
Follows #9644, #9743