Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions dash/dash-renderer/src/wrapper/ExternalWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ type Props = {
/**
* For rendering components that are out of the regular layout tree.
*/
function ExternalWrapper({component, componentPath}: Props) {
function ExternalWrapper({
component,
componentPath,
temp = false
}: Props & {temp?: boolean}) {
const dispatch: any = useDispatch();
const [inserted, setInserted] = useState(false);

Expand All @@ -33,7 +37,9 @@ function ExternalWrapper({component, componentPath}: Props) {
);
setInserted(true);
return () => {
dispatch(removeComponent({componentPath}));
if (temp) {
dispatch(removeComponent({componentPath}));
}
};
}, []);

Expand Down