Skip to content

Conversation

@STRML
Copy link
Collaborator

@STRML STRML commented Dec 31, 2025

Summary

Removes the declare module 'react-draggable' wrapper from TypeScript definitions and uses direct exports instead. This fixes type pollution issues when multiple versions of react-draggable end up in a project's dependencies.

This is a fresh implementation of the fix proposed in #690.

Changes

  • Removed declare module 'react-draggable' wrapper from typings/index.d.ts
  • Updated typings/tsconfig.json to use path mapping for the test file

Why this works

The global module declaration is unnecessary as TypeScript will automatically associate the typings with the react-draggable module since they're declared in package.json. The previous approach caused type pollution in complex dependency scenarios.

See reproduction repo: https://github.com/pgoldberg/react-draggable-typings-bug

Test plan

  • Lint passes (includes TypeScript type checking)
  • All 102 unit tests pass

Removes the `declare module 'react-draggable'` wrapper from TypeScript
definitions and uses direct exports instead. This fixes type pollution
issues when multiple versions of react-draggable end up in a project's
dependencies.

The global module declaration is unnecessary as TypeScript will
automatically associate the typings with the `react-draggable` module
since they're declared in package.json.

Closes #690
@STRML STRML force-pushed the fix/typescript-module-690 branch from 07c6864 to 08e265e Compare December 31, 2025 04:13
@STRML STRML merged commit 679e269 into master Dec 31, 2025
7 checks passed
@STRML STRML deleted the fix/typescript-module-690 branch December 31, 2025 04:17
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