Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6212

How to omit one property from interface, but not with type in TypeScript?

$
0
0

I need to make one interface that extends from 2 another, but I get the error: Interface 'IModalProps' cannot simultaneously extend types 'ModalProps' and 'ModalRNProps'.   Named property 'onShow' of types 'ModalProps' and 'ModalRNProps' are not identical.:

export interface IModalProps extends ModalProps, ModalRNProps {  showCloseButton?: boolean;  showDoneBar?: boolean;}

I can do omit only with type like this:

type OmitA = Omit<ModalProps, "onShow">; 

But I can not after make extends with type, because it is possible only with interfaces. Can you tell me please how can I omit one property from the interface and after create one extendable interface from a few interfaces?


Viewing all articles
Browse latest Browse all 6212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>