Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

287
Views
React-Native FlatList takes more space than needed

I have a simple compoenent set up as to demonstrate my issue.

I have a base component BaseScreenCenterTop

const BaseScreenCenterTop = ({ children, ...props }) => {
  return (
    <View style={[styles.container, props.style]}>
      {children}
    </View>
  )
}

const styles = StyleSheet.create({
  container: {
    display: 'flex',
    flex: 1,
    flexDirection: 'column',
    alignItems: 'center',
    justifyContent: 'flex-start',
    width: '100%',
    height: '100%',
    paddingVertical: 30
  },
})

and my main component:

<BaseScreenCenterTop>
  <View style={{backgroundColor: 'green', height: 30, width: '100%'}}>
  </View>
  <View>
    <FlatList
      data={doc.items}
      renderItem={({ item }) => renderItem(item)}
      keyExtractor={item => item.id}
    />
  </View>
  <View>
    <Button
      title="Test"
    />
  </View>
</BaseScreenCenterTop>

The result I get is:

Actual screen render

And I want the FlatList to get the full height, but still have the Button visible at the end.

I tried many things to fix this, but it seems that the FlatList just sets its height to the maximum it can get until the end of the view, ignoring that there is stuff after it.

Thank you!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!