You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to pass some other props to RightContent, such as status: boolean/index: number, but it only accept props: { size: number; }, e.g. I pass status: boolean to right, then TS warns:
I'm not a experienced TS user, unfortunately I don't know what should I do now. Is there some methods, like TS Interface Inheritance, that I can extend the right prop's type to:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm using Card.Title component, and it's right prop's type is(left's type is similar to this) :
I want to pass some other props to RightContent, such as
status: boolean
/index: number
, but it only acceptprops: { size: number; }
, e.g. I passstatus: boolean
to right, then TS warns:Then I tried to move RightContent into it's parent component to access these props, but React warns:
I'm not a experienced TS user, unfortunately I don't know what should I do now. Is there some methods, like TS Interface Inheritance, that I can extend the right prop's type to:
so I can pass some props I needed to the Card.Title's left/right prop?
Beta Was this translation helpful? Give feedback.
All reactions