primitives
primitives copied to clipboard
Adding support for framework image component in Radix Avatar
Description
Hello there, how you guys doing?
As discussed in issue #2230, we would love to enhance image optimization by integrating the Next.js Image component. I've implemented a solution that allows us to utilize the Next.js Image component while maintaining the existing functionality.
In this update, I've removed the image load logic from useLayoutEffect and delegated it directly to the respective components. This means that Primitive.img will handle image loading as usual, while the Next.js Image component will load images with its optimizations.
I would greatly appreciate your feedback on this solution. Let's collaborate to refine this feature and ensure it meets our needs.