Skip to content

ContextError: useScrollAreaScrollbarContext returned undefined... in SolidJS implementation #571

Description

@pedrodesu

Description:
I am encountering a ContextError when using the ScrollArea component in a SolidJS project using the components generated by the Park UI CLI.

Current Implementation:
TypeScript

<ScrollArea.Root>
<ScrollArea.Viewport>
<ScrollArea.Content>

Hello


</ScrollArea.Content>
</ScrollArea.Viewport>
<ScrollArea.Scrollbar />
<ScrollArea.Corner />
</ScrollArea.Root>

The Issue:

  • With the implementation above (as the official docs suggest), the console throws: ContextError: useScrollAreaScrollbarContext returned undefined. Seems you forgot to wrap component within <ScrollAreaScrollbarProvider />
  • The generated ui/scroll-area.tsx components are already wrapped with withProvider/withContext, which I believe should handle the context injection automatically as per standard Park UI architecture.
  • There is no exported ScrollArea.ScrollbarProvider or anything of the sort in the library to manually wrap the component, even if that were the intended workaround.

Expected Behavior:
The ScrollArea.Scrollbar should already wrap its own Provider if necessary, or at least have such an export and have the suggested usage in the docs properly corrected.

Environment:

  • Framework: SolidJS
  • Component Library: Park UI (latest)
  • Implementation: Standard generated components via CLI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions