Created
January 17, 2019 20:36
-
-
Save emarref/7f073795a600ba4ef89d39deec3d1a86 to your computer and use it in GitHub Desktop.
A dummy component to hilight IDE autocompletion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { connect } from 'react-redux'; | |
interface RootState { | |
dataFromRootState: string; | |
} | |
interface OwnProps { | |
manualOwnProp: string; | |
} | |
interface StateProps { | |
somePropFromMapStateToProps: string; | |
} | |
interface DispatchProps {} | |
type Props = OwnProps & StateProps & DispatchProps; | |
const mapStateToProps = (state: RootState): StateProps => { | |
return { somePropFromMapStateToProps: state.dataFromRootState }; | |
}; | |
class DummyComponent extends React.Component<Props> { | |
render() { | |
const { somePropFromMapStateToProps } = this.props; | |
return <p>{somePropFromMapStateToProps}</p>; | |
} | |
} | |
export default connect(mapStateToProps)(DummyComponent); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment