Closed
Description
Bug Report
π Search Terms
spread missing props
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about spreading
β― Playground Link
π» Code
function Foo(props: {x: string}) {
Bar({y: "hi", ...props});
}
function Bar(_props: {y:string}) {
}
Or the React version of the same thing:
import React from 'react';
function Foo(props: {x: string}) {
return <Bar y="hi" {...props}/>
}
function Bar(_props: {y:string}) {
return <div/>
}
π Actual behavior
Spread is allowed
π Expected behavior
This should be an error because the spread source {x: string}
does not overlap with the destination type {y: string}
.