-
-
Notifications
You must be signed in to change notification settings - Fork 639
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
"@dnd-kit/core": major | ||
--- | ||
|
||
The `layoutMeasuring` prop of `DndContext` has been renamed to `measuring`. | ||
|
||
The options that could previously be passed to the `layoutMeasuring` prop now need to be passed as: | ||
```diff | ||
<DndContext | ||
- layoutMeasuring={options} | ||
+ measuring={{ | ||
+ droppable: options | ||
+ }} | ||
``` | ||
|
||
The `LayoutMeasuring` type has been renamed to `MeasuringConfiguration`. The `LayoutMeasuringStrategy` and `LayoutMeasuringFrequency` enums have also been renamed to `MeasuringStrategy` and `MeasuringFrequency`. | ||
|
||
This refactor allows consumers to configure how to measure both droppable and draggable nodes. By default, `@dnd-kit` ignores transforms when measuring draggable nodes. This beahviour can now be configured: | ||
|
||
```tsx | ||
import { | ||
DndContext, | ||
getBoundingClientRect, | ||
MeasuringConfiguration, | ||
} from '@dnd-kit/core'; | ||
|
||
const measuringConfig: MeasuringConfiguration = { | ||
draggable: { | ||
measure: getBoundingClientRect, | ||
}, | ||
}; | ||
|
||
function App() { | ||
return <DndContext measuring={measuringConfig} /> | ||
} | ||
``` |