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
however if you try to use "spread" syntax, it's a type error:
declareconstinfoProps: InfoProps<Info{...infoProps}/>/* . ^^^^^^^^^^^^^^Type '{ status: "hidden" | "visible"; }' is not assignable to type '(IntrinsicAttributes & { status: "hidden"; }) | (IntrinsicAttributes & { status: "visible"; conte...'. Type '{ status: "hidden" | "visible"; }' is not assignable to type 'IntrinsicAttributes & { status: "visible"; content: string; }'. Type '{ status: "hidden" | "visible"; }' is not assignable to type '{ status: "visible"; content: string; }'. Types of property 'status' are incompatible. Type '"hidden" | "visible"' is not assignable to type '"visible"'. Type '"hidden"' is not assignable to type '"visible"'.*/
As I understand it, this should be no different semantically from
Just hit on exactly the same problem, reproducible in 2.4.1 and 2.5.2. Another example:
importReact,{SFC}from'react';{typeCommonProps={common: string};typeProps=CommonProps&({type: 'foo'}|{type: 'bar';message: string});constButton: SFC<Props>=(props)=>null;constOtherButton1: SFC<Props>=(props)=>React.createElement(Button,props);// Type '"foo"' is not assignable to type '"bar"'.constOtherButton2: SFC<Props>=(props)=><Button{...props}/>;}
Activity
OliverJAsh commentedon Sep 25, 2017
Just hit on exactly the same problem, reproducible in 2.4.1 and 2.5.2. Another example: