Flex props do not work for components
See original GitHub issueBefore creating a new issue, please confirm:
- I have searched for duplicate or closed issues and discussions.
- I have tried disabling all browser extensions or using a different browser
- I have tried deleting the node_modules folder and reinstalling my dependencies
- I have read the guide for submitting bug reports.
On which framework/platform are you having an issue?
React
Which UI component?
Other
How is your app built?
Create React App
What browsers are you seeing the problem on?
Chrome
Please describe your bug.
If I put my TextField
inside a Flex
component and set the grow
to 1, the property does not get set in the CSS. Same goes for other components like SelectField
, etc.
What’s the expected behaviour?
According to the docs, grow
, flex
, and other flex properties should work for all UI React components.
Help us reproduce the bug!
- Create jsx like so:
<Flex direction={'row'} backgroundColor={'pink'}>
<TextField label={'Label!'} grow={1}/>
</Flex>
- See that the TextField does not get stretched out.
- See that the CSS is not applied
Code Snippet
No response
Additional information and screenshots
Actual:
Expected:
Issue Analytics
- State:
- Created a year ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Flex component props not working as expected #540 - GitHub
Describe the bug Flex component does not accept flexDirection prop To Reproduce /** @jsx jsx */ import { jsx } from "theme-ui"; import...
Read more >CSS Flex property not working with my React Component
I'm working with a React project that requires me to use Flex in my styling. All have done is just not working have...
Read more >Work with Components and Props - Twilio Flex
Directly reusing components from the Flex UI library is discouraged. Importing and using an existing component (e.g. MessagingCanvas ) and adding your own ......
Read more >Layout Props - React Native
When flex is -1, the component is normally sized according to width and height . However, if there's not enough space, the component...
Read more >Styled Components - Emotion
Any interpolations or arguments that are functions in styled are called with props , this allows you to change the styles of a...
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 Free
Top 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
@dbanksdesign @slaymance We were going to open another issue as a P1 on
display=none
not completely working on certain components. I’m guessing it’s addressed by this change, but just wanted to confirm. If not, I’ll open a separate issue:@hein-j Yes, that will be addressed together along with the change