ghulamabbas2 / bookit

bookit.vercel.app
85 stars 55 forks source link

TypeError: nextCallback is not a function #1

Open ziasultan2 opened 3 years ago

ziasultan2 commented 3 years ago

Hi dear, I'm following your course. When I add this line in my project it throws the error

export const getServerSideProps = wrapper.getServerSideProps(async ({req, store}) => {
    await store.dispatch(getRooms(req))
})

Server Error TypeError: nextCallback is not a function

This error happened while generating the page. Any console logs will be displayed in the terminal window.

webcorptech commented 3 years ago

use like this

export const getStaticProps = wrapper.getStaticProps((store) => async (req) => { await store.dispatch(getRooms()); });

Rajan03 commented 3 years ago

Thi will work...

export const getServerSideProps = wrapper.getServerSideProps(store => async ({req, res}) => { await store.dispatch(getRooms(req)); })