github clauderic/dnd-kit @dnd-kit/abstract@0.3.0

Minor Changes

  • 6a59647 Thanks @clauderic! - Allow plugins, sensors, and modifiers to accept a function that receives the defaults, making it easy to extend or configure them without replacing the entire array.

    // Add a plugin alongside the defaults
    const manager = new DragDropManager({
      plugins: (defaults) => [...defaults, MyPlugin],
    });
    // Configure a default plugin in React
    <DragDropProvider
      plugins={(defaults) => [
        ...defaults,
        Feedback.configure({dropAnimation: null}),
      ]}
    />

    Previously, passing plugins, sensors, or modifiers would replace the defaults entirely, requiring consumers to import and spread defaultPreset. The function form receives the default values as an argument, so consumers can add, remove, or configure individual entries without needing to know or maintain the full default list.

Patch Changes

  • Updated dependencies []:
    • @dnd-kit/geometry@0.3.0
    • @dnd-kit/state@0.3.0

Don't miss a new dnd-kit release

NewReleases is sending notifications on new releases.