Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

143
Views
React - access exported const

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:

error

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!