react-image-webp icon indicating copy to clipboard operation
react-image-webp copied to clipboard

Add support for Server Side Rendering

Open MBach opened this issue 6 years ago • 4 comments

Hello,

I'm building an App which uses next.js but I cannot make your component to work when using SSR. In Chrome, in the console, I have this:

Warning: Prop `src` did not match. Server: "/static/images/logo.png" Client: "/static/images/logo.webp"

In the end, I'm always returing the fallback image. Could you implement SSR with next.js?

Regards,

Matthieu

MBach avatar Feb 25 '18 19:02 MBach

Hello @MBach!

Interesting task, i will think about how implement it in next.js in next few days.

Thanks!

DonRai avatar Feb 26 '18 07:02 DonRai

Great news! Looking forward to reading from you

MBach avatar Feb 26 '18 20:02 MBach

Any news?

Warchant avatar Dec 01 '18 16:12 Warchant

Hello! My package react-img-webp supports server-side render using react context. You can pass Accept header from http request and everything will be rendered. On client-side additional webP support check will be done.

Horat1us avatar Jan 27 '19 00:01 Horat1us