Atyantik/react-pwa

async data

egaleme opened this issue · 5 comments

Please what is the equivalent of getInitialProps in nextjs in ReactPwa

@egaleme check out the file: https://github.com/Atyantik/react-pwa/blob/master/src/pages/guest.js#L40 for details kindly check the section of routes for skeleton-loading now this loadData loads data from the server and pass it on to component component: () => import('../components/skeleton-loading'),

Please check out the file https://github.com/Atyantik/react-pwa/blob/master/src/components/skeleton-loading.js#L7 that utilizes the loadedData from 'loadData' as props and uses it to render in the component.

Hope that helps.

Thanks it works. By the way why should anyone use ReactPwa against Nextjs. What are the advantages?

SEO friendly, multidomain support, image optimizations, any library extend-abilty, no dependency build, docker friendly etc.. I never got a chance to 100% check the difference, but I will conduct a benchmark for performance as well.

Ok Cool. Looking forward to your benchmark.

How do implement context api for ssr in ReactPwa