You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem?
Yes, there's an unnecessary type casting in the ThemeProvider component that indicates a deeper type system issue. Currently, the component has to cast children to ReactNode despite it being typed as AdminChildren, which is a code smell and indicates a type system inconsistency. Current Implementation:
In packages/ra-ui-materialui/src/theme/ThemeProvider.tsx, there's a forced type cast: {children as ReactNode} with a comment acknowledging the issue: 'Had to cast here because Provider only accepts ReactNode but we might have a render function. Proposed Solution:
Review and fix the type definitions for AdminChildren to properly handle both ReactNode and render functions. Update the ThemeProvider component to use proper type constraints 3. Remove the type casting and update the component's type signature. Benefits:
Improved type safety - Better developer experience - Cleaner code without type assertions - More maintainable type system.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem?
Yes, there's an unnecessary type casting in the ThemeProvider component that indicates a deeper type system issue. Currently, the component has to cast children to ReactNode despite it being typed as AdminChildren, which is a code smell and indicates a type system inconsistency.
Current Implementation:
In packages/ra-ui-materialui/src/theme/ThemeProvider.tsx, there's a forced type cast: {children as ReactNode} with a comment acknowledging the issue: 'Had to cast here because Provider only accepts ReactNode but we might have a render function.
Proposed Solution:
Review and fix the type definitions for AdminChildren to properly handle both ReactNode and render functions. Update the ThemeProvider component to use proper type constraints 3. Remove the type casting and update the component's type signature.
Benefits:
Improved type safety - Better developer experience - Cleaner code without type assertions - More maintainable type system.
The text was updated successfully, but these errors were encountered: