Skip to content

Supporting Flexible Hierarchies by Making the <Stack /> Interface More Flexible #621

@SEOKKAMONI

Description

@SEOKKAMONI

stackflow provides the component to support stack-based page transitions in a webview environment.
Inside this component, there are ConfigProvider, PluginsProvider, CoreProvider, and MainRenderer, and
stackflow functions such as push and pop can only be used within this provider hierarchy.

Meanwhile, overlay UIs such as toasts or modals are usually rendered at the top level of the application using Context.
For example, libraries like overlay-kit manage overlays through their own Provider at the top level.

The issue arises when stackflow is used together with libraries that follow this top-level rendering pattern.
If the overlay component is placed outside the provider hierarchy,
stackflow functions like push and pop cannot be called from within the overlay.

overlay-kit + stackflow example

return (
  <QueryClientProvider client={queryClient}>
    <Suspense>
      <OverlayProvider>
        <Stack />
      </OverlayProvider>
    </Suspense>
  </QueryClientProvider>
);

Therefore, I’d like to hear your thoughts on improving the interface to address this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions