An example of how to use the render() lifecycle hook to switch between templates in a Lightning web component
Blog post: https://sfdc.danielzeidler.com/2019/07/12/using-the-lwc-render-lifecycle-hook-to-switch-templates/
- Create a scratch org:
sfdx force:org:create -s -f config/project-scratch-def.json -a lwc-render-hook-example
- Push the app to your scratch org:
sfdx force:source:push
- Assign the LWC Render Lifecycle Hook Example permission set to the default user:
sfdx force:user:permset:assign -n LWC_Render_Lifecycle_Hook_Example
- Open the scratch org:
sfdx force:org:open
- In App Launcher, select the LWC Render Lifecycle Hook Example app.