import { useEffect } from 'react'
import { useDispatch } from 'react-redux'
import Link from 'next/link'
import getStore from '../store'
import { startClock, serverRenderClock } from '../actions'
import Examples from '../components/examples'
const Index = () => {
const dispatch = useDispatch()
useEffect(() => {
dispatch(startClock())
}, [dispatch])
return (
<>
Click to see current Redux State
>
)
}
export async function getStaticProps() {
const store = getStore()
store.dispatch(serverRenderClock())
return {
props: {},
}
}
export default Index