rsnext/examples/with-overmind/pages/about.js
Jesse Jafa 2e5a7c8cc8
Removed redundant react imports from with-overmind (#13422)
Per https://github.com/zeit/next.js/issues/12964

Removed redundant react imports from next.js/examples/with-overmind
2020-05-27 04:12:07 +00:00

25 lines
626 B
JavaScript

import Header from '../components/Header'
import { createOvermindSSR } from 'overmind'
import { config } from '../overmind'
export async function getStaticProps() {
// If we want to produce some mutations we do so by instantiating
// an Overmind SSR instance, do whatever datafetching is needed and
// change the state directly. We return the mutations performed with
// "hydrate"
const overmind = createOvermindSSR(config)
overmind.state.page = 'About'
return {
props: { mutations: overmind.hydrate() },
}
}
export default function AboutPage() {
return (
<div>
<Header />
</div>
)
}