Skip to content

fix: improve type safety in Grainient component#871

Open
khoinguyenpham04 wants to merge 2 commits intoDavidHDev:mainfrom
khoinguyenpham04:fix/grainient-type-safety
Open

fix: improve type safety in Grainient component#871
khoinguyenpham04 wants to merge 2 commits intoDavidHDev:mainfrom
khoinguyenpham04:fix/grainient-type-safety

Conversation

@khoinguyenpham04
Copy link

Replace 'as any' type assertions with specific types:

  • program.uniforms.iTime: { value: number }
  • program.uniforms.iResolution: { value: Float32Array }

This improves type safety and prevents potential runtime errors.

Why: I love the new Grainient component and I used it in my codebase, however, after npm run build there was a ts error, so I decided to fix it and create this PR. Hope this helps!

@Utkarsh-Singhal-26
Copy link
Contributor

Utkarsh-Singhal-26 commented Feb 4, 2026

Hi @khoinguyenpham04, thanks for the PR! Replacing as any with explicit types is a solid improvement 👍

Could you also apply the same change in the ts-default file?
src/ts-default/Backgrounds/Grainient/Grainient.tsx

Thanks!

@khoinguyenpham04
Copy link
Author

Hi @Utkarsh-Singhal-26, thanks for reviewing my PR!

I just applied the same changes to ts-default! Both files now use explicit types instead of as any.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants