Skip to content

Commit

Permalink
fix: ts types for canvas texture seem broken
Browse files Browse the repository at this point in the history
  • Loading branch information
drcmda committed May 6, 2023
1 parent ef82580 commit 8b77f05
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/GradientTexture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type Props = {
} & JSX.IntrinsicElements['texture']

export function GradientTexture({ stops, colors, size = 1024, ...props }: Props) {
const canvas = React.useMemo(() => {
const canvas: HTMLCanvasElement = React.useMemo(() => {
const canvas = document.createElement('canvas')
const context = canvas.getContext('2d')!
canvas.width = 16
Expand All @@ -22,5 +22,6 @@ export function GradientTexture({ stops, colors, size = 1024, ...props }: Props)
context.fillRect(0, 0, 16, size)
return canvas
}, [stops])
// @ts-ignore ????
return <canvasTexture args={[canvas]} attach="map" {...props} />
}

1 comment on commit 8b77f05

@vercel
Copy link

@vercel vercel bot commented on 8b77f05 May 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.