I have defined two LWC's one is Reactive & other is non reactive .So NOn reactive component should not rerender its values ,But both the LWC's reredenring property values.Let me know what is the issue in my code Below is my code. 1html code:
<template>
<table style="background: white;">
<tr>
<td>
Reactive Private property
<lightning-input type="text" onchange={changeHandler1}></lightning-input>
<br/>
<b>value: {reactivePrivateProperty}</b>
</td>
</tr>
<tr>
<td>
Non Reactive Private property
<lightning-input type="text" onchange={changeHandler2}></lightning-input>
<br/>
<b>value: {nonReactivePrivateProperty}</b>
</td>
</tr>
</table>
</template>
[2]JS code:
import { LightningElement,track} from 'lwc';
export default class PrivateComponent extends LightningElement {
@track reactivePrivateProperty;
nonReactivePrivateProperty;
changeHandler1(event)
{
this.reactivePrivateProperty= event.target.value;
}
changeHandler2(event)
{
this.nonReactivePrivateProperty=event.target.value;
}
}
[3] css code
table tr td{
padding:10px;
border:1px solid black;
}
[4] xml code:
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="privateComponent">
<apiVersion>46.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__AppPage</target>
<target>lightning__RecordPage</target>
<target>lightning__HomePage</target>
</targets>
</LightningComponentBundle>