LWC

Avoid Lightning Data Services

Don't use Lightning Data Services unless it's for a read only requirement, and even then please get permission ahead of implementation.

Use Single a @Track variable

Where possible use a single @track variable in your JavaScript rather than creating a @track variable for each property.

@track user

Rather than:

@track userName;
@track userEmail;
@track userPhone;

This reduces the amount of code to write.

You can access properties in the HTML like this:

<lightning-input label="Name" value={user.Name} />

Last updated