Why react native components don't work

Created At: 2021-04-08 18:31:25 Updated At: 2021-04-09 01:10:48

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.

Comment

Add Reviews