Code the constructor

A class constructor is normally used to initialize instance-specific data. However, if your component implements lifecycle methods, then you should use these methods to manage instance-specific data. Otherwise, instance-specific initialization must be done in the constructor.

Any uncaught exception that is thrown within the constructor aborts the creation of the new component instance.