import React from 'react' import {connect} from 'react-redux' interface IComponentProps { value: string } interface IStateProps { value: string } export class Component extends React.PureComponent { constructor(props: IComponentProps) { super(props) this.state = { value: props.value, } } handleChange = (e: React.ChangeEvent) => { this.setState({ value: e.target.value, }) } render() { return (
{this.state.value}
) } } function mapStateToProps(state: any) { return { value: state.value, } } export const CComponent = connect(mapStateToProps)(Component)