question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Flex props do not work for components

See original GitHub issue

Before creating a new issue, please confirm:

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!

  1. Create jsx like so:
      <Flex direction={'row'} backgroundColor={'pink'}>
        <TextField label={'Label!'} grow={1}/>
      </Flex>
  1. See that the TextField does not get stretched out.
  2. See that the CSS is not applied

Code Snippet

No response

Additional information and screenshots

Actual: Screen Shot 2022-09-20 at 11 56 39 Screen Shot 2022-09-20 at 11 56 14

Expected: Screen Shot 2022-09-20 at 11 56 57 Screen Shot 2022-09-20 at 11 56 53

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
hein-jcommented, Sep 24, 2022

@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:

Screen Shot 2022-09-23 at 17 23 10 Screen Shot 2022-09-23 at 17 23 06
0reactions
zchenweicommented, Dec 5, 2022

@hein-j Yes, that will be addressed together along with the change

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found