Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grid stops working when adding Row Col using child component #103

Open
nechmads opened this issue Apr 20, 2020 · 2 comments
Open

Grid stops working when adding Row Col using child component #103

nechmads opened this issue Apr 20, 2020 · 2 comments

Comments

@nechmads
Copy link

nechmads commented Apr 20, 2020

If I do something like:
<Grid> <Row> <Col> <Text>1</Text> </Col> </Row> <Row> <Col> <Text>2</Text> </Col> </Row> </Grid>
everything is working fine.

BUT - if I do something like:
<Grid> <MyHeader /> <Row> <Col> <Text>2</Text> </Col> </Row> </Grid>

And MyHeader is:

const MyHeader = () => { return ( <Row> <Col> <Text>1</Text> </Col> </Row> ) }

The grid totally breaks down and the row somehow displayed 20 pixels from the right edge of the screen.
Basically - if you put a Row element through a custom component the grid breaks. Can't understand why...

I use React Native 0.62

@pbrazdil
Copy link

shouldn't MyHeader be wrapped with as well?

@tdotdm
Copy link

tdotdm commented Jan 4, 2021

I had the same issue as @nechmads. As suggested by @pbrazdil , wrapping my custom component in Grid fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants