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

242
Views
How to do it some items or headers should not render multiple time in react native

I have Table on right side there is columns on the top each box there is heading so . I just Want that. that heading should not repeat. on each box . it should only repeat on the top of the column.

here is code - https://snack.expo.dev/@xeteke8423/sellerformat

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can solve that by passing the index prop to the SecondaryBox and render the heading conditionally.

Make following changes in your codebase:

App.js:

//.......
              <View>
                {sample.map((item) => (
                  <View style={{ flexDirection: 'row' }}>
                    {item['sellerId']?.map((buyer, index) => (
                      <SecondaryBox sellerId={buyer} index={index} />
                    ))}
                  </View>
                ))}
              </View>
//.......

And in your SecondaryBox.js render the heading conditionally like below:

//............
<ScrollView horizontal>
          {
            <View style={{ flexDirection: 'row' }}>
              <View style={{ marginLeft: 10 }}>
                {index === 0 ? (
                  <View style={{position: ""}}>
                    <Text>Seller Profile</Text>
                    <Text>View Remark</Text>
                    <Text>Unit/Price</Text>
                  </View>
                ) : (
                  <View style={{ height: 55 }}></View>
                )}
//............

Here is the output:

enter image description here

about 4 years ago · Juan Pablo Isaza Report
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!