salesforce / lwc

⚡️ LWC - A Blazing Fast, Enterprise-Grade Web Components Foundation
https://lwc.dev
Other
1.6k stars 386 forks source link

array mutations are not reactive in a custom lightning-datatable component. #4341

Open vignesh191 opened 6 days ago

vignesh191 commented 6 days ago

Description

When using a custom type lightning-datatable, methods such as push, pop, and splice on the data array are not reactive and do not cause a re-render on the custom type datatable element.

Steps to Reproduce

An example of a custom type lightning-datatable is described in these developer docs

As described in the above linked docs, a custom type datatable consists of the following layers:

LWC version: 6.5.3

nolanlawson commented 6 days ago

Thanks for filing! Do you have a repro you can share, e.g. using https://playground.lwc.dev?

I tried to write a minimal repro, but my repro seems to be working as documented. If I use @track and @api, then I can use push/pop/splice and the rendered output is updated.