TanStackT
TanStack15mo ago
7 replies
verbal-lime

How to open a dialog from a child Outlet route?

I have a dialog in a parent component. I want my outlet routes to be able to open that dialog but can't find a way to pass the openDialog function the child route since outlet doesnt accept props.

const openDeleteDialog = (type: string, itemId: number) => { setDeleteDialogOpen(true); setItemToDelete(itemId); setItemType(type); };

I have a function like this that needs to be called in the child route. Any help would be appreciated thanks!
Was this page helpful?