-
Notifications
You must be signed in to change notification settings - Fork 30.6k
Regression in connect from @types/react-redux@7.0.2 allows any props #36873
Copy link
Copy link
Closed
Description
- I tried using the
@types/react-redux@6.0.14 -> 7.1.1package and had problems. - I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
- Mention the authors (see
Definitions by:inindex.d.ts) so they can respond.- Authors: @tkqubo @kenzierocks @clayne11 @tansongyang @NicholasBoll @mDibyo @Kallikrein @val1984 @jrakotoharisoa @apapirovski @surgeboris @soerenbf @MrWolfZ
If you do not mention the authors the issue will be ignored.
I can't pinpoint the commit / change that introduced the regression, just the version. Versions after 7.0.1 will seemingly allow any props, even ones with the wrong type.
Repro:
import React from 'react'
import { connect } from 'react-redux'
interface Props {
title: string
}
const Example = (props: Props) => <div>{props.title}</div>
const ExampleConnected = connect()(Example)
const ThisShouldNotCompile = () => (
<div>
{/* This errors, as it should. */}
<Example />
{/* Yet this happily compiles. */}
<ExampleConnected />
</div>
)Versions before 7.0.2 will show an error for both elements in ThisShouldNotCompile.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels