shadergradient icon indicating copy to clipboard operation
shadergradient copied to clipboard

How to change color without full rerender?

Open shizz-x opened this issue 1 year ago • 1 comments

On your site https://www.shadergradient.co/customize colors change quickly and without losing animation frames. How can I reproduce this?

This happens to me when I try to change the color of the react state-

https://github.com/user-attachments/assets/6d7f3a3f-ba50-47e3-897a-6578d5422710

shizz-x avatar Sep 03 '24 01:09 shizz-x

@shizz-x Can you tell me a little more about the environment you're experiencing this issue in? I'm wondering if you're working in Framer or in a local development environment (React, etc.) Also, it would be helpful if you could explain a bit more about the code you're using or how you're implementing it.

anonymousRecords avatar Sep 09 '24 11:09 anonymousRecords

I've updated prop change & shader material updating logic from v2 (packages/shadergradient-v2/src/ShaderGradient/Mesh/Materials.tsx)

check our new package (@shadergradient/react) and this example :)

apps/example-nextjs-dev/app/page.tsx

ruucm avatar Nov 10 '24 07:11 ruucm