Skip to content

adds flag to ExternalWrapper to identify if the component is a temporary insertion #3319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 3, 2025
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