I want to know the pros and cons of using session or view props instead of using the component property binding directly to another component
Session props are available to the whole session and can act as global variables and a simple means of passing data from one view to another. I use them regularly for things such as date range selection that is to be applied across views.
View props can behave similarly. Advantages include:
- All the variables can be located in the same place.
- Bindings to the view props means that bindings continue to work when components are moved up and down branches in the project tree. For example, wrapping a component in a container will move that component down a level and break any bindings to or from that component. Binding to the view props avoids that.