Exploring the index.ts file
Once you have initialized your PCF project you can find an index.ts file in your control folder, as we discussed in the Getting to know the files and the folder structure section. This file will have four functions already defined for you, along with an empty constructor. Let's go over the importance of these four functions.
The init function
This is the first function that gets invoked when the control is loaded and is never invoked again until the control is reloaded. For example, when you navigate between records, the control is reloaded. This function can be used to initialize a control's UI. You can also invoke remote server calls and any other initialization that needs to happen when your controls load.
It has four parameters:
- context: This is the most important object provided by the framework that gives us access to all the properties and methods that are available in the Power Apps component framework. It also contains...