Comments (4)
I can't use it in nextjs
ReferenceError: window is not defined
at Yo node_modules/@brainhubeu/react-carousel/lib/react-carousel.js:2:100449
It would be great to have SSR support.
from react-carousel.
Facing the same issue: undefined (window) in SSR
from react-carousel.
In these cases I usually wrap it into something like this:
`function Page({ render = "effect", children } = {}) {
const [hasRenderedOnClient, setHasRendered] = React.useState(false);
React.useEffect(() => {
setHasRendered(true);
}, []);
if (render === "effect" && !hasRenderedOnClient) {
return null;
}
if (render === "effect-seo" && !hasRenderedOnClient) {
return <div style={{ visibility: "hidden" }}>{children};
}
return <>{children}</>;`
so it renders when useEffect kicks in on the client.
Only downside is that js has to be downloaded in order to see the carousel
from react-carousel.
why do you call this react-carousel? carousel doesn't work with react, gatsby, or next..there are 3 more closed(!) window issues related to this...dynamic import doesn't bring the module and why should we dynamic import anyway...
from react-carousel.
Related Issues (20)
- Cannot update a component while rendering a different component. Probably due to bad setState() HOT 7
- White stace
- Warning: Cannot update a component (`re`) while rendering a different component (`wi`). To locate the bad setState() call inside `wi`, follow the stack trace as described in
- Warning: Cannot update a component (`re`) while rendering a different component (`wi`). To locate the bad setState() call inside `wi`, follow the stack trace as described in HOT 16
- Custom Arrow Plugin Setting Right Arrow Class Incorrectly HOT 3
- Why there is no working carousel for React? HOT 6
- Garbage with no support? HOT 1
- Autoplay without Infinite appears to have unexpected behavior
- Every single aspect of this carousel is buggy HOT 4
- Link to pages like href=""?
- cannot add breakpoint porps HOT 2
- "infinite plugin doesn't work" HOT 1
- Carousel fails when we use the itemWidth setting along with the infinite setting. HOT 2
- Module parse failed: Unexpected token on react-carousel.js HOT 1
- Support React 17.x HOT 11
- RTL Plugin Infinite doesn't work
- Project still maintained? HOT 1
- Facing an issue "ReferenceError: window is not defined"
- Remove renovate
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-carousel.