Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6290

How to set Switch component separately for each item that comes From API in React native

$
0
0

I have an API and I need to set the switch button separately for eachitem. I read different answers but didn't solve my problem as I triedall of the answers.

const results = [   {            Id: "IySO9wUrt8",            Name: "Los Stand",            Category: "Mexican",            Status: true,        },    {            Id: "IySO9wUrt8",            Name: "Los Stand 2",            Category: "Burger",            Status: true,        },     {            Id: "IySO9wUrt8",            Name: "Los Stand 3",            Category: "BBq",            Status: true,        },      ];

in the above code I need to set the Status in switch . If status istrue then the switch will be ON

for all the code I share the link of expo for live editing

Expo Link for Editing


Viewing all articles
Browse latest Browse all 6290

Trending Articles