I am working on lighting components newly. I have array of object, which I have assed to @track decorator of LWC variable.
I wanted to dynamically update the this assed variable, how to do it? I am getting error. Or is there any way to do it?
@track assetsFilters = [
{ name: 'drilling', checked: false },
{ name: 'offshore', checked: false },
{ name: 'others', checked: false }
];
I tried out and updating the data using JSON parse & JSON stringfy.
[{"name":"drilling","checked":false},{"name":"offshore","checked":false},{"name":"others","checked":false}];
What is best way to re-assign values to proxy object. Whether directly assign them or other way method, like react uses setState method to update values.
Ex Directly assign
this.assetsFilters = [{"name":"drilling","checked":false},{"name":"offshore","checked":false},{"name":"others","checked":false}];