Closed
Description
TypeScript Version: 2.3.1
Code
With the above mentioned version I can't spread Props objects anymore to child React components, when the Props don't match up 100%.
/* App.tsx */
interface Props {
...
scopes: any;
}
interface State {}
export class App extends React.Component<Props, State> {
render() {
return <Content {...this.props} />; // error
}
}
/* Content.tsx */
interface Props {
...
// without scopes in Props
}
export default class Content extends React.Component<Props, {}>{
...
}
Expected behavior:
No error and there wasn't any on 2.2.1
Actual behavior:
error:
ERROR in ./spa/js/comps/App.tsx
(121,49): error TS2322: Type '{ ui?: UIState; session?: SessionState; scopes?: any; users?: any; roles?: any; plugins?: any; us...' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Content> & Props & { children?: ReactNode; }'.
Property 'scopes' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Content> & Props & { children?: ReactNode; }'.