You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an array and I want this toggle button for each element inside the array. How can I make it specific to each element? Currently, on one click, it makes changes to all the toggle buttons I have on the page. I want to make it specific. Any help is appreciated. Thanks!
The text was updated successfully, but these errors were encountered:
@imar26 This has nothing to do with react-toggles and you probably have figured it out already but just for completeness:
The problem is most likely in your onChange function. You need to update just the one toggles that got clicked and not every toggle in the array. You can achieve this e.g. by passing an id into your onChange-handler (or any other field or combination of fields that are unique). See https://jsfiddle.net/triepm/n5u2wwjg/218256/ for a quick example.
Hi,
I have an array and I want this toggle button for each element inside the array. How can I make it specific to each element? Currently, on one click, it makes changes to all the toggle buttons I have on the page. I want to make it specific. Any help is appreciated. Thanks!
The text was updated successfully, but these errors were encountered: