3
al-m
6y

Anyone good with react-native? I need help cause I'm about to lose my shit 😭 not even exaggerating when I say I've cried many times over this.

Comments
  • 0
    What's the problem? I'll try to help. If I can't, there's probably many here who can :)
  • 0
    @hacker hi!!! I have a link to it on stack overflow I'll get it in a sec. But basically.
    I'm using a library that was refusing to even render on android and while I was trolling around I saw that it's literally because there is a "flex: 1" in the styling and without it it works but like. Looks dreadful and stuff and everything is all over the place. So I don't know what to do anymore
  • 0
  • 1
    @al-m I recently started learning React Native so forgive me if this solution is too hacky...
    I had a similar issue today with a ScrollView which shrunk its children to fit the screen (I didn't want that). And it was happening because of the 'flex: 1' applied to the view. I removed it and set it's height and width to 100% of the screen dimensions using the Dimension API: https://facebook.github.io/react-na...

    Let me know if that works. I'm curious because it worked for me, but perhaps doesn't for other use cases...
  • 0
    I'd like to see if anyone else has any other (better) ideas...
  • 0
    @hacker I'll do that right now actually. Did you remove the flex entirely? And the width and height did you add those to the component itself or the wrapping one?
  • 0
    hmmm, not sure i get how to use this api tbh
  • 0
    @al-m I put it on the wrapping one and removed flex entirely. The children elements, in my case, were given fixed dimensions. I'll post a screen shot of how I did it. Hold up
  • 0
    hmmm, yeah this made it render for sure but like... a lot more issues lol
  • 0
    @al-m something like this:
  • 0
    Which creates this:
  • 0
    @al-m it works perfectly for me. What other issues?
    Hopefully I still helped in some way :)
Add Comment