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

231
Views
I receive an undefined value when I pass the value of a variable through props from a parent component to a child component

I create a variable pointsFilter in app.js and through props I send the value to a child component in this case the component is Map but when I want to extract the value I get undefined and when i do a console.log in app i get the value but when i do the same in map.js i get undefined

app.js

const [pointsFilter, setPointsFilter] = useState(true)

<Map onLongPress={handleLongPress} puntos={puntos} poinstFilter={pointsFilter} />

map.js

    export default ({ onLongPress, puntos, pointsFilter }) => {

  console.log(pointsFilter)

  return (
    <Mapview style={styles.map} onLongPress={onLongPress} >
      {pointsFilter && puntos.map(x => <Marker coordinate={x.coordinate} title={x.name} key={x.name} />)}
    </Mapview>
  )
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

On app.js you pass poinstFilter and on Map, you try to extract pointsFilter. Use the same name on both sides. Moreover, I don't see the component name on your Map component. You may create components as

const export default Map= ({ onLongPress, puntos, pointsFilter })

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!