Answer the question
In order to leave comments, you need to log in
How to type redux connected & React.memo component?
How to type redux connected & React.memo component?
interface OwnProps {
a: SomeType;
b: SomeType;
}
interface StateProps {
c: SomeType;
d: SomeType;
}
type Props = OwnProps & StateProps;
const SomeComponent: React.FC<Props> = (props) => {}
const mapStateToProps = state => ({
c: 'value',
d: 'value'
})
const connected = connect(mapStateToProps)(SomeComponent);
const areEqual = (prev: Props, next: Props) => {...};
export default React.memo(connected, areEqual);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question