i am trying to access an exported const:
import { connect } from 'react-redux'
function Home (products) {
return (
<Component products={products}>
)
}
export function getServerSideProps() {
const state = store.getState()
const { products, loading } = state.productList
console.log('serverProps products:')
console.log(products)
return {props: {products: products, loading: loading}}
}
export default connect(getServerSideProps)(Home)
getServerSideProps() needs to be exported and it needs to be used in connect(getServerSideProps)(Home). when i remove the export from getServerSideProps() the connect(getServerSideProps)(Home). but it needs to be exported as well for server-side-rendering.
error: