refactor: modify MeshType
In ShaderGradient.propertyControls, position and rotation were defined as objects, but in the GradientT type, these were defined as individual properties (positionX, positionY, positionZ, rotationX, rotationY, rotationZ). This caused a type mismatch error.
can you also update usages parts of the passed position & rotation props?
e.g) packages/shadergradient-v2/src/ShaderGradient/Mesh/Mesh.tsx 28-29
@ruucm
can you also update usages parts of the passed
position&rotationprops?e.g)
packages/shadergradient-v2/src/ShaderGradient/Mesh/Mesh.tsx28-29
I fixed it.
we also need to update packages/shadergradient-v2/src/presets.ts
The props of shadergradient should be synced as URL queries. (similar to packages/shadergradient/src/store/presets.ts)
So if we use nested props as you suggested, we'll need a neat function to convert them into URL queries.
Please include it in the same file (packages/shadergradient-v2/src/presets.ts)
@ruucm
we also need to update
packages/shadergradient-v2/src/presets.tsThe props of shadergradient should be synced as URL queries. (similar to
packages/shadergradient/src/store/presets.ts)So if we use nested props as you suggested, we'll need a neat function to convert them into URL queries.
Please include it in the same file (
packages/shadergradient-v2/src/presets.ts)
I applied types to the presets.ts file and, for separation of concerns, moved the URL conversion function to a separate urlUtils.ts file. However, as you mentioned, it's also fine to keep the URL conversion function in presets.ts, so feel free to share your opinion and I can adjust accordingly.
Additionally, I encountered an issue where 'React' was referencing the UMD global, so I imported React to resolve the issue.