Skip to content

[Solid, React?] If beforeLoad is a sync function, context is not merged #5986

@elite174

Description

@elite174

Which project does this relate to?

Router

Describe the bug

The thing is that beforeLoad function MUST return promise for having correct context for child components. If it's synchronous, then child function may not see the context, so here's either typescript bug (which allows to pass sync function to beforeLoad) or context merge bug.

Your Example Website or App

Steps to Reproduce the Bug or Issue

just make beforeLoad synchronous and try to read the context from child's loader function

Expected behavior

Context should be merged correctly

Screenshots or Videos

No response

Platform

"@tanstack/solid-router": "1.139.10",
"@tanstack/solid-start": "1.139.10",

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions