Skip to content

Instantly share code, notes, and snippets.

@Sawtaytoes
Last active September 20, 2018 03:25
Show Gist options
  • Save Sawtaytoes/4ffcb4f661e17aea141731e661f0e044 to your computer and use it in GitHub Desktop.
Save Sawtaytoes/4ffcb4f661e17aea141731e661f0e044 to your computer and use it in GitHub Desktop.
Example using `connect` from react-redux.
import React from 'react'
import { connect } from 'react-redux'
const TestComponent = ({
text,
}) => (
<div>
{text}
</div>
)
const mapStateToProps = (
({ text }) => (
text,
)
)
const TestComponent = (
connect(
mapStateToProps
)(
TestComponent
)
)
export default TestComponent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment