Skip to content

Commit d91fe7c

Browse files
committed
adds flag to ExternalWrapper to identify if the component is a temporary insertion
1 parent 1951d67 commit d91fe7c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dash/dash-renderer/src/wrapper/ExternalWrapper.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type Props = {
1818
/**
1919
* For rendering components that are out of the regular layout tree.
2020
*/
21-
function ExternalWrapper({component, componentPath}: Props) {
21+
function ExternalWrapper({component, componentPath}: Props, temp?: boolean = false) {
2222
const dispatch: any = useDispatch();
2323
const [inserted, setInserted] = useState(false);
2424

@@ -33,7 +33,7 @@ function ExternalWrapper({component, componentPath}: Props) {
3333
);
3434
setInserted(true);
3535
return () => {
36-
dispatch(removeComponent({componentPath}));
36+
if (temp) dispatch(removeComponent({componentPath}));
3737
};
3838
}, []);
3939

0 commit comments

Comments
 (0)