// Helper method to provide the current component instance in the name of a `parentType`. // The `parentType` defaults to `Parent` when omitting the second parameter. const provideParent = (component: any, parentType?: any) => { return { provide: parentType || Parent, useExisting: forwardRef(() => component) }; };