react-native-select-two icon indicating copy to clipboard operation
react-native-select-two copied to clipboard

using select twice in app

Open fericoder opened this issue 4 years ago • 2 comments

i want to use two react-native-select-two component in my Js Class. Unfortunately after change one of them, another select selected data changes. state variables name is different.

how can i use two Select Two component ?

fericoder avatar Dec 05 '20 10:12 fericoder

same problem

brunoribeiro-lab avatar May 08 '21 02:05 brunoribeiro-lab

Hello I hope you are well, sorry for my english

the problem basically is not of librarie, the problem is the way you implement, let me explain it, you are using redux I guess redux is inmutable but in this case is not true, for solve this you have to make this way

let neighbords_subscribes = neighborhoods.map((value:any) => ({...value}));

or

let neighbords_subscribes:any = [];

neighborhoods.forEach( (element:any) => { let temp:any = new Object(); for (var name in element) { temp[name] = element[name] } neighbords_subscribes.push(temp); });

where neighborhoods is the array of objects from redux and here you make a real deep copy, remember map return new array, or foreach is the same in this case, choose what you want, so each time you visita page you have to run this function and solve the problem.

I hopre this can help some one

andresfmm avatar Jul 09 '23 04:07 andresfmm