[system] `component` prop lost when wrapping with `styled`
See original GitHub issueDuplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Current behavior 😯
I discovered this while trying to override component
for a styled ListSubheader
in our app. I tried it for ListItem
as well but not others - it seems that when wrapping a component with styled
, the component
prop is lost and TS errors out.
Expected behavior 🤔
component
prop is not lost
Steps to reproduce 🕹
See codesandbox
Context 🔦
No response
Your environment 🌎
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:8
- Comments:6 (2 by maintainers)
Top Results From Across the Web
[system] component prop lost when wrapping with styled #29875
I discovered this while trying to override component for a styled ListSubheader in our app. I tried it for ListItem as well but...
Read more >Styled component not wrapping another styled component
I have a Popup component like so: import React, { useEffect } from 'react'; import styled from 'styled-components'; const Div = styled. div` ......
Read more >Advanced Usage - styled-components
Theming. styled-components has full theming support by exporting a <ThemeProvider> wrapper component. This component provides a theme to all React components ...
Read more >Wrapping a MUI component with styled ... - YouTrack
Wrapping a MUI component with styled-components breaks autocomplete for props ... Use autocompletion for the MUI component to get the alignContent prop and ......
Read more >Text - React Native
The style inheritance is only encoded inside of the native Text component and doesn't leak to other components or the system itself. Reference....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can confirm this issue still exists in 5.4.4 Can be fixed this way, but it’s definitely a bug:
Not sure if this helps narrow down the problem, but it seems that
React.ComponentProps
doesn’t report thecomponent
prop for MUI components. From what I can see,styled
usesReact.ComponentProps
internally.