mirror of
https://github.com/mathuo/dockview
synced 2025-09-01 23:16:25 +00:00
feat: components prop changes are propagated
This commit is contained in:
parent
017e6856f9
commit
647945debc
@ -152,6 +152,24 @@ export const DockviewReact = React.forwardRef(
|
||||
};
|
||||
}, []);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!dockviewRef.current) {
|
||||
return;
|
||||
}
|
||||
dockviewRef.current.updateOptions({
|
||||
frameworkComponents: props.components,
|
||||
});
|
||||
}, [props.components]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!dockviewRef.current) {
|
||||
return;
|
||||
}
|
||||
dockviewRef.current.updateOptions({
|
||||
frameworkTabComponents: props.tabComponents,
|
||||
});
|
||||
}, [props.tabComponents]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!props.onTabContextMenu || !dockviewRef.current) {
|
||||
return () => {
|
||||
|
@ -96,6 +96,15 @@ export const GridviewReact = React.forwardRef(
|
||||
};
|
||||
}, []);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!gridviewRef.current) {
|
||||
return;
|
||||
}
|
||||
gridviewRef.current.updateOptions({
|
||||
frameworkComponents: props.components,
|
||||
});
|
||||
}, [props.components]);
|
||||
|
||||
return (
|
||||
<div
|
||||
className={props.className}
|
||||
|
@ -104,13 +104,19 @@ export const PaneviewReact = React.forwardRef(
|
||||
}, []);
|
||||
|
||||
React.useEffect(() => {
|
||||
paneviewRef.current?.updateOptions({
|
||||
if (!paneviewRef.current) {
|
||||
return;
|
||||
}
|
||||
paneviewRef.current.updateOptions({
|
||||
frameworkComponents: props.components,
|
||||
});
|
||||
}, [props.components]);
|
||||
|
||||
React.useEffect(() => {
|
||||
paneviewRef.current?.updateOptions({
|
||||
if (!paneviewRef.current) {
|
||||
return;
|
||||
}
|
||||
paneviewRef.current.updateOptions({
|
||||
headerframeworkComponents: props.headerComponents,
|
||||
});
|
||||
}, [props.headerComponents]);
|
||||
|
@ -91,6 +91,15 @@ export const SplitviewReact = React.forwardRef(
|
||||
};
|
||||
}, []);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!splitviewRef.current) {
|
||||
return;
|
||||
}
|
||||
splitviewRef.current.updateOptions({
|
||||
frameworkComponents: props.components,
|
||||
});
|
||||
}, [props.components]);
|
||||
|
||||
return (
|
||||
<div
|
||||
className={props.className}
|
||||
|
Loading…
x
Reference in New Issue
Block a user