Skip to content
This repository has been archived by the owner on Nov 25, 2021. It is now read-only.

Does it support Server Side rendering ? #61

Closed
pravinarr opened this issue Aug 22, 2018 · 3 comments
Closed

Does it support Server Side rendering ? #61

pravinarr opened this issue Aug 22, 2018 · 3 comments

Comments

@pravinarr
Copy link

Hello,

I am creating a SSR react application with express server. I tried to include flip page animation but ended up getting the following error t.defineProperty(o,"defa

ReferenceError: window is not defined
at Object. (/Users//git///node_modules/react-flip-page/dist/index.js:1:316)
at Module._compile (module.js:577:32)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object. (/Users//git///dist/server.js:238:18)
at webpack_require (/Users//git///dist/server.js:20:30)

Does this package support SSR ? if yes, is there a way to fix this issue ?

thank you in advance.

@darenju
Copy link
Owner

darenju commented Aug 22, 2018

Hello,

No sorry, this package does not support server-side rendering for now.
I have no idea how to do so to be honest.

If you know how to do so, please feel free to fork the project and implement this server-side rendering feature.

Thank you for reporting.

@darenju darenju closed this as completed Dec 1, 2018
@kkomelin
Copy link

kkomelin commented Mar 26, 2019

Briefly, you may want to use:

  1. Dynamic imports in Next.js [WIP] Add dynamic import support vercel/next.js#1750
  2. Or this project https://github.com/kadirahq/react-no-ssr

The idea is simple - run your window-dependent code on client only.

@Ashar2shahid
Copy link

For those still struggling

import dynamic from "next/dynamic";  
const FlipPage = dynamic(() => import("react-flip-page"), {
  ssr: false,
});


function yourComponent() {
return(
 <FlipPage>
 <div>1</div>
 <div>2</div>
 </FlipPage>
 )
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants