I am using TS React Redux and my app state looks something like this
type AppState = {
foo: number
bar: number
baz: number
}
and I have a component whose hooked up to redux like so
type ComponentState = {
foo: number
bar: number
}
function mapStateToProps(state: AppState): ComponentState{
return {
foo: state.foo,
bar: state.bar
}
}
My question is that in mapStateToProps, is there any way to copy over the props without having to select each one individually? Since ComponentState is a subset of AppState I feel like there is an obvious way to do this that I'm missing.