Skip to content

Props are marked as required in TypeScript #807

@joshkel

Description

@joshkel

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions