feat: components prop changes are propagated

This commit is contained in:
mathuo 2022-02-16 20:22:14 +00:00
parent 017e6856f9
commit 647945debc
No known key found for this signature in database
GPG Key ID: C6EEDEFD6CA07281
4 changed files with 44 additions and 2 deletions

View File

@ -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 () => {

View File

@ -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}

View File

@ -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]);

View File

@ -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}