Flex: 1 - react-native-web
See original GitHub issueThe main style does not work for react-native-web
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
backgroundColor: 'gold',
justifyContent: 'center'
},
text: {
alignItems: 'center',
fontSize: 24
}
})
export default props => (
<View style={styles.container}>
<View style={{ position: 'absolute', top: '50%', right: '15%' }}>
<Text style={{ fontSize: 80, textAlign: 'right' }} >
Home
</Text>
</View>
</View>
Now so
It must be so
System information
- OS: macOS
- Browser (if applies) all
- Version of Next.js: 6.0.3
the solution height: '100%'
does not fit
How to be?
Issue Analytics
- State:
- Created 5 years ago
- Comments:17 (17 by maintainers)
Top Results From Across the Web
react-native-web · Issue #4450 · vercel/next.js - Flex: 1 - GitHub
The parent element of your container is not a flex element, so flex: 1 has no impact on the container height. Unrelated, when...
Read more >Layout with Flexbox - React Native
flex will define how your items are going to “fill” over the available space ... The red view uses flex: 1 , the...
Read more >React Native Stylesheet: what does {flex:1} do? - Stack Overflow
Here's a CodePen that demonstrates that flex: 1 the way React Native examples use it doesn't do anything in CSS:.
Read more >Using flexbox in React Native - LogRocket Blog
Developing a mobile app in React Native? Use Flexbox, a CSS tool that enables you to build layouts to fit multiple screen sizes....
Read more >Flexbox: How to use it to style thoroughly in React Native
In short, CSS Flexible Box Layout, commonly known as React native flex 1, is a CSS 3 web layout model. It is likewise...
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
Instead of adding
display: flex
to the body, target the<div id="__next" />
element with CSS. The below is updated code from the RNW example.I’m going to close this as @dcalhoun is right. 👍