In Features.jsx and PageThree.jsx, we are using the IntersectionObserver API to detect whether the component is in the viewport or not. However, since we are already using framer-motion in this project, we could instead use the whileInView prop provided by framer-motion.
The whileInView prop provides a declarative way to create scroll-triggered animations. It is more concise and easier to read than using the IntersectionObserver API directly.
I understand that framer-motion uses IntersectionObserver under the hood, but I believe that using the whileInView prop would make the code cleaner and more maintainable.
This is just a suggestion, but if the maintainers are fine with it, I would be happy to create a pull request to implement this change.
Features.jsx
andPageThree.jsx
, we are using theIntersectionObserver
API to detect whether the component is in the viewport or not. However, since we are already usingframer-motion
in this project, we could instead use thewhileInView
prop provided by framer-motion.whileInView
prop provides a declarative way to create scroll-triggered animations. It is more concise and easier to read than using theIntersectionObserver
API directly.framer-motion
usesIntersectionObserver
under the hood, but I believe that using the whileInView prop would make the code cleaner and more maintainable.