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.

Default flexDirection should be 'row', not 'column'

See original GitHub issue

The default style value for flexDirection is 'column'. According to the specs (referenced in LayoutPropTypes.js), it should be 'row'.

React Native version: 0.24.1 Device: Android (Genymotion)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
vjeuxcommented, May 4, 2016

I tried to document the decisions behind the default values here and a css reset you can use on your web projects to have the same behavior: https://github.com/facebook/css-layout/blob/master/README.md

For the default row, I have never understood why this choice was made in CSS, it doesn’t make any sense to me. The only reason I can think of is that the original use cases where flexbox was designed for were things that normal css doesn’t work and involve horizontal things maybe?

If you are not convinced that this is a good choice, look at the number of View you output in your app and the number of flexDirection: ‘row’. The second number is likely ridiculously small.

2reactions
antoinerousseaucommented, May 4, 2016

Imho it’s okay to not care about specs, but only if there is a good reason. Otherwise what’s the point of using the Flexbox model if we can’t rely on our existing knowledge? In any case, it would be good to provide the default values in the docs then.

Read more comments on GitHub >

github_iconTop Results From Across the Web

flex-direction - CSS: Cascading Style Sheets - MDN Web Docs
The flex-direction CSS property sets how flex items are placed in the flex container defining the main axis and the direction (normal or ......
Read more >
flex-direction
The flex-direction property is a sub-property of the Flexible Box Layout module. It establishes the main-axis, thus defining the direction ...
Read more >
flex-direction: row is not working; it's still displaying as a ...
My problem is that I do not know why "flex-direction: row;" won't change the nav bar to fit side by side. .top-nav li...
Read more >
CSS | flex-direction Property
row :It arrange the row same as text direction .The default value of flex-direction is row. It is used to specify that the...
Read more >
Layout with Flexbox
The defaults are different, with flexDirection defaulting to column instead of row , alignContent defaulting to flex-start instead of ...
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