SSR and responsive mode
See original GitHub issueI already open this issue on the nextjs repo but it seems to be a problem with react-slick.
Describe the bug When I use next.js with react-slick and responsive options, there is a bug during the rehydration phase, the src attribute of the images are mixed between the slides.
The error message is Warning: Prop src did not match. Server: "http://via.placeholder.com/350x150?text=7" Client: "http://via.placeholder.com/350x150?text=8"
To Reproduce I made an example from examples folder : https://github.com/padupuy/next.js/tree/feature/with-react-slick
The code is right here : https://github.com/padupuy/next.js/blob/feature/with-react-slick/examples/with-react-slick/pages/index.js
Expected behavior The image sources must not be mixed
Screenshots
System information
- OS: macOS High Sierra 10.13.4
- Browser (if applies) : at least chrome and safari
- Version of Next.js: at least 5.1 and 6.0.2
Issue Analytics
- State:
- Created 5 years ago
- Reactions:24
- Comments:30
This is my solution:
I don’t know if is the best approach but I solved this problem by using dynamic import