-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Description
- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
The Hidden component documentation states: "Any other props supplied will be provided to the root element (native element)." (see https://material-ui.com/api/hidden/)
However, the typescript declaration file for the component does not declare all the native underlying div properties, and the properties are not passed down, except for the className (which is not declared anyway for typescript users).
I use the CssHidden implementation of the component.
Expected Behavior 🤔
I should be able to add custom styles to the underlying div element using className or style properties.
Steps to Reproduce 🕹
Very simple: create a typescript project, use <Hidden mdUp implementation="css" className="whatever">, it does not compile.
Context 🔦
I want to add custom style to the div element generated by the Hidden component, using either className or style property (I need height="100%" at each level here).
I made this workaround for now:
const FixHidden = Hidden as React.ComponentType<HiddenProps & {className: string}>