Skip to content

Instantly share code, notes, and snippets.

@craigayre
Created November 16, 2017 17:24
Show Gist options
  • Save craigayre/53434b74fe64f1cb186011aacf6be524 to your computer and use it in GitHub Desktop.
Save craigayre/53434b74fe64f1cb186011aacf6be524 to your computer and use it in GitHub Desktop.
import React from 'react';
import { connect } from 'react-redux'
import PropTypes from 'prop-types'
import Page from '../components/page';
export class Index extends React.Component {
static contextTypes = {
store: PropTypes.object,
}
render() {
return (
<div>
<div className="hero">
{JSON.stringify(this.context.store)}
</div>
<style jsx>{`
`}</style>
</div>
)
}
}
// Or, instead of static
// Index.contextTypes = { store: PropTypes.object }
export default connect(null)(Page(Index));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment