Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: type error with @types/three@0.156.0 #1647

Merged
merged 1 commit into from
Sep 9, 2023

Conversation

Methuselah96
Copy link
Contributor

Why

Using drei with @types/three@0.156.0 produces a type error because of the change in meaning to the generic parameter for Object3D:

ERROR in node_modules/@react-three/drei/web/Select.d.ts:13:53
TS2344: Type 'Event<string, unknown>' does not satisfy the constraint 'Object3DEventMap'.
  Type 'Event<string, unknown>' is missing the following properties from type 'Object3DEventMap': added, removed
    11 | };
    12 | export declare function Select({ box, multiple, children, onChange, onChangePointerUp, border, backgroundColor, filter: customFilter, ...props }: Props): JSX.Element;
  > 13 | export declare function useSelect(): THREE.Object3D<THREE.Event>[];
       |                                                     ^^^^^^^^^^^
    14 | export {};
    15 |

What

Add explicit return type annotation with explanatory comment to avoid regression.

Checklist

  • Documentation updated (example) - N/A
  • Storybook entry added (example) - N/A
  • Ready to be merged

Sorry, something went wrong.

@vercel
Copy link

vercel bot commented Sep 9, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
drei ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 9, 2023 6:41pm

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 9, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit fc5eac5:

Sandbox Source
sad-mountain-57s5ly Configuration
Ground reflections and video textures Configuration
arc-x-pmndrs-colors Configuration

@github-actions
Copy link

github-actions bot commented Sep 9, 2023

🎉 This PR is included in version 9.83.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants