開発者は、Lightning データテーブル内のレコードのリストを表示する Lightning Web コンポーネントを作成しています。新しいレコードをデータベースに保存した後、リストが更新されません。 これを実現するには、開発者は上記のコードの何を変更する必要がありますか 起こる?
正解:C
In Lightning Web Components (LWC), the data displayed in a component is not automatically refreshed when a new record is saved to the database. To refresh the displayed list of records in a lightning-datatable after a save operation, developers should use the refreshApex() function. This function is imported from the @salesforce/apex module and is used to refresh the cache and re-execute the Apex wire method to fetch the latest data from the server. The @track decorator is no longer necessary in most cases due to reactive properties being the default behavior in LWC as of Spring '20 release. Also, calling refreshApex() on this.data directly or creating a new tracked variable will not initiate a refresh of the cached data. References: Get Updated Data with refreshApex() Lightning Web Components and Salesforce Data