I am a trying to make a component which gets passed to react-redux's connect function.
The component is as follows:
interface ITestProps {
id: number
}
class TestComponent extends React.Component<ITestProps, {}> {
render() {
return (<div>
{this.props.name}
</div>)
}
}
mapStateToProps(state) {}
mapDispatchToProps(dispatch) {}
let ConnectedComponent = connect(
mapStateToProps,
mapDispatchToProps
)(TestComponent)
The above code seems to work find if i render ConnectedComponent like so
<ConnectedComponent></ConnectedComponent>
i.e without the id prop. Shouldn't it throw an error since the ConnectedComponent is simply the connected form of TestComponent and TestComponent should have props of the form ITestProps.
Is this how it is supposed to behave or am I doing something wrong.
export default connect(mapStateToProps, mapDispatchToProps)(TestComponent);and then< TestComponent ></TestComponent >?typings.jsonentry"react-redux": "registry:dt/react-redux#4.4.0+20160501125835"