Skip to content
Advertisement

How can I change to horizontal alignment when using map in React native?

I have data called hello.

If I have hello[0] data, I want to run hello.map and list the buttons. However, the Pressable component is vertically aligned, but I want to do it horizontally.

So, I am trying to change the direction by giving a View on top of the map function. If i put a View, an Unexpected Token error occurs.

How do I fix my code?

JavaScript

Advertisement

Answer

Change your code like this

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement