kevinfarrugia / react-glider

A ReactJS wrapper for Glider.js
https://react-glider.vercel.app/
MIT License
208 stars 42 forks source link

Replaced useLayoutEffect with useEffect #119

Closed kevinfarrugia closed 2 years ago

kevinfarrugia commented 2 years ago

What's Changing

Replaced useLayoutEffect with useEffect to remove server-side warning as document in #111. This would enable you to render the Glider on the server-side and then progressively enhance it once the client-side scripts are available.

useLayoutEffect is synchronous and blocks visual updates, so following the change to useEffect, the Glider is initialized after content is painted to the screen.

Dependent on https://github.com/NickPiscitelli/Glider.js/pull/235

Change Type

Marked as a major change since users may see a sudden increase in layout shift as the Glider is initialized later.