In the new 4.6.0 release, all or nearly all props of the Draggable component are marked as required in TypeScript. This results in many TypeScript compilation errors. For example, the demo from the README:
function App() {
const nodeRef = useRef(null);
return (
<Draggable nodeRef={nodeRef}>
<div ref={nodeRef}>Drag me!</div>
</Draggable>
);
results in the following errors:
Type '{ children: Element; nodeRef: MutableRefObject; }' is missing the following properties from type 'Pick<DraggableProps, "position" | "grid" | "children" | keyof DraggableCoreDefaultProps | "cancel" | "offsetParent" | "handle" | ... 7 more ... | "positionOffset">': position, scale, grid, onDrag, and 17 more.ts(2740)
In the new 4.6.0 release, all or nearly all props of the Draggable component are marked as required in TypeScript. This results in many TypeScript compilation errors. For example, the demo from the README:
results in the following errors: