One way data binding in Lightning web components

One way data binding in lwc,lwc, lightning web components, props down events up lwc
Props down events up in lwc

In LWC one way data binding only allowed but in Aura it allows two way binding using bound expression where we can’t able to retain proper encapsulation but through one way binding in lwc we can keep data as much as independent as possible.

If the child component want to change property value in owner component it can be done via firing an event from child component, Also If the Property value in owner component got changed via an event triggered from child component then the value will propagate down to child component via one way binding.

In this below lwc example, we can see how the one way binding(Props down) and property value change in owner component(events up) works through on a button click.

 






Reference:- https://jasonformat.com/props-down-events-up/

Be the first to comment

Leave a Reply

Your email address will not be published.


*