Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using select twice in app #39

Open
fericoder opened this issue Dec 5, 2020 · 2 comments
Open

using select twice in app #39

fericoder opened this issue Dec 5, 2020 · 2 comments

Comments

@fericoder
Copy link

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 ?

@brunoribeiro-lab
Copy link

same problem

@andresfmm
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants