DonRai / react-image-webp

React component for check browser support format .webp and insert if supported this image
MIT License
44 stars 8 forks source link

Add support for Server Side Rendering #12

Open MBach opened 6 years ago

MBach commented 6 years ago

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

DonRai commented 6 years ago

Hello @MBach!

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

Thanks!

MBach commented 6 years ago

Great news! Looking forward to reading from you

Warchant commented 5 years ago

Any news?

Horat1us commented 5 years ago

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.