Grid not work as aspected if nested inside <Content>-Component
See original GitHub issueIn the Docs (https://docs.nativebase.io/Components.html#Layout) I’ve found that <Grid> was inside <Content>.
But this does not work as descriped in the Docs, because it looks like this:
If I adjust the code like this to get rows:
import React, {Component} from "react";
import {
Text,
} from 'react-native';
import {Container, Header, Left, Content} from 'native-base';
import {Col, Row, Grid} from 'react-native-easy-grid';
export default class Login extends Component<{}> {
render() {
return (
<Container >
<Header ><Left ><Text >Headline</Text ></Left ></Header >
<Content >
<Grid >
<Row size={1} style={{backgroundColor: '#635DB7'}} ><Text >No.1</Text ></Row >
<Row size={3} style={{backgroundColor: '#00CE9F'}} ><Text >No.2</Text ></Row >
</Grid >
</Content >
</Container >
);
}
}
It Looks like this:
Only if I remove the <Content>
-Tag, it seems to show in the right way:
This seems to be an Bug!?, because the docs of nativebase.io suggest to have one <Content>
-Tag at each Screen.
I’ve debugged it with react-devtools, and find out, that the first View inside the ScrollView has no flex-declaration. If I add this like in the Screen, the two rows are shown in the right way:
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
React Material UI Nested Grid - Not working - Stack Overflow
I have put the three boxes in another grid that will go to a max-width of 1200px. this is so it looks neat...
Read more >"translating" a grid object to HTML structure (using VueJS) - Support ...
First off: This is my first post in this community, so please don't kill me if ... If the grid appears to have...
Read more >formio/formio - Gitter
I finally got it working by using the unsecure (not https) version of the portal. ... i set grid type as form and...
Read more >formiojs/Changelog.md - UNPKG
82, - FIO-3758: Duplication of radio ids inside nested forms ... validation does not work for components inside components that have data of...
Read more >PeopleCode built-in functions and language constructs
If the model field is not in a grid, the system inserts the new field onto the page to ... List of parameters...
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
@xstable you can set the prop
contentContainerStyle={{flex:1}}
for<Content/>
component to get the same behaviour as in docs.https://github.com/GeekyAnts/native-base-docs/issues/75