Check out example codes for "how to make input in angular optional". It will help you in understanding the concepts better.

Code Example 1

export class ChildComponent {

    @Input() showName?: boolean;

    constructor() { }

}

Learn ReactJs, React Native from akashmittal.com