online software programming courses

Why react native components don't work

Why react native components don't work

onPress Event

First reason

React native onPress does not work, there could be many reasons. When you are trying to printing log on the console, you need to pass a function. 

onPress={()=>console.log('react')}

But many beginners might just pass a line instead of returning a function. Beginners might do it like below

onPress={console.log('react')}

The above line won't print any logs during the rendering.

Second reason

If you have too many components within the parent view. You might need to include zIndex.