I am very new to react and material-IU. This is the structure that is passed to each selector to configure it and that shows the three default options
export const questionOptions = {
defaultValue: undefined,
control: {
type: "select",
options: {
Accept: true,
Decline: false,
Unknown: undefined,
},
},
};
And this is how each component is configured for the title and its options
export const types = {
startAdornment: {
title: "First Text",
...questionOptions,
},
startAdornment: {
title: "Second Text",
...questionOptions,
},
}
I have to create a third select and I want to show only the first two options so I clone the object and modify the properties I want
export const questionOptionsTwo = Object.assign({}, questionOptions);
questionOptionsTwo.control.options = { Accept: true, Decline: false, }
And then use this new object for the third select
startAdornment: {
title: "Third Text",
...questionOptionsTwo,
},
the problem is that, although I am cloning the original object, when I modify the properties in the cloned object they are also modified in the original.
What am I doing wrong? thank you all in advance