mirror of
https://github.com/mathuo/dockview
synced 2025-02-02 22:45:48 +00:00
Merge pull request #742 from mathuo/741-remove-depreciated-method
chore: remove depricated method
This commit is contained in:
commit
3f3ed52007
@ -13,7 +13,6 @@ import {
|
|||||||
PROPERTY_KEYS,
|
PROPERTY_KEYS,
|
||||||
DockviewComponentOptions,
|
DockviewComponentOptions,
|
||||||
DockviewFrameworkOptions,
|
DockviewFrameworkOptions,
|
||||||
DockviewDndOverlayEvent,
|
|
||||||
DockviewReadyEvent,
|
DockviewReadyEvent,
|
||||||
createDockview,
|
createDockview,
|
||||||
} from 'dockview-core';
|
} from 'dockview-core';
|
||||||
@ -56,10 +55,6 @@ export interface IDockviewReactProps extends DockviewOptions {
|
|||||||
onReady: (event: DockviewReadyEvent) => void;
|
onReady: (event: DockviewReadyEvent) => void;
|
||||||
onDidDrop?: (event: DockviewDidDropEvent) => void;
|
onDidDrop?: (event: DockviewDidDropEvent) => void;
|
||||||
onWillDrop?: (event: DockviewWillDropEvent) => void;
|
onWillDrop?: (event: DockviewWillDropEvent) => void;
|
||||||
/**
|
|
||||||
* @deprecated use `api.onUnhandledDragOverEvent` instead. This will be removed in the next release.
|
|
||||||
*/
|
|
||||||
showDndOverlay?: (event: DockviewDndOverlayEvent) => boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function extractCoreOptions(props: IDockviewReactProps): DockviewOptions {
|
function extractCoreOptions(props: IDockviewReactProps): DockviewOptions {
|
||||||
@ -203,26 +198,6 @@ export const DockviewReact = React.forwardRef(
|
|||||||
};
|
};
|
||||||
}, [props.onDidDrop]);
|
}, [props.onDidDrop]);
|
||||||
|
|
||||||
React.useEffect(() => {
|
|
||||||
if (!dockviewRef.current) {
|
|
||||||
return () => {
|
|
||||||
// noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const disposable = dockviewRef.current.onUnhandledDragOverEvent(
|
|
||||||
(event) => {
|
|
||||||
if (props.showDndOverlay?.(event)) {
|
|
||||||
event.accept();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return () => {
|
|
||||||
disposable.dispose();
|
|
||||||
};
|
|
||||||
}, [props.showDndOverlay]);
|
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (!dockviewRef.current) {
|
if (!dockviewRef.current) {
|
||||||
return () => {
|
return () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user