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
import{TextAreaasFUITextArea,TextAreaPropsasFUITextAreaProps}from'@4design/for-ui'typeName='firstName'|'lastName'typeTextAreaProps=Omit<FUITextAreaProps,'name'>&{name: Name}constTextArea=(props: TextAreaProps)=>(// Types of property 'minRows' are incompatible.// Type 'number | undefined' is not assignable to type 'undefined'.// Type 'number' is not assignable to type 'undefined'<FUITextArea{...props}/>)
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
-
概要
FUIからexportされているProps型の一部 (TextAreaProps等) を変更して使おうとするとエラーになる
解決方法
Omitがタグ付きUnionを破壊してしまうのが原因である。 (参照1 、参照2)
これを解決するには
このようなOmitを定義して使うようにする
Beta Was this translation helpful? Give feedback.
All reactions