You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypeScript: DefaultProps fields incorrectly required in Props type #263
In react-resizable@4.0.1, the bundled TypeScript types in build/propTypes.d.ts define Props as DefaultProps & { ... }, which makes all DefaultProps fields (axis, handleSize, lockAspectRatio, minConstraints, maxConstraints, resizeHandles, transformScale) required.
These props all have runtime defaults and should be optional. The previous @types/react-resizable (DefinitelyTyped) correctly modeled them as optional.
Reproduction
import{ResizableBox}from'react-resizable';// TS Error: Type '{ children: Element; width: number; height: number; }'// is missing the following properties from type 'Readonly<ResizableBoxProps>':// axis, handleSize, lockAspectRatio, minConstraints, and 3 more.<ResizableBoxwidth={800}height={350}><div>content</div></ResizableBox>
This worked in previous versions when types came from @types/react-resizable. Since v4.0.1 ships its own types (via "types": "./build/index.d.ts" in package.json), TypeScript resolves the bundled types and @types/react-resizable is ignored.
Activity
bkje14 commentedon Jun 18, 2026
I ran into the same issue when trying to update to 4.x. #264 would be nice to have.