-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
Which project does this relate to?
Router (SolidJS)
Describe the bug
The api Route.useLoaderDeps()
returns an Accessor<T>
but it's type definition says it returns the raw object directly, see below:
export const Route = createFileRoute('/')({
component: IndexComponent,
validateSearch: type({
test: 'string = ""',
}),
loaderDeps: (opts) => ({test: opts.search.test}),
})
function IndexComponent() {
const deps = Route.useLoaderDeps() satisfies {test: string};
// @ts-expect-error
const _ = deps satisfies () => {test: string};
console.log(typeof deps, deps, (deps as unknown as () => {test:string})().test);
// function, <function useStore>, <empty string>
return <Outlet/>;
}
Your Example Website or App
stackblitz.com/~/github.com/Zuruuh/solid-typings-error-reproducer?file=src/routes/index.tsx
Steps to Reproduce the Bug or Issue
Open the console or run tsc
Expected behavior
The API should define it returns an Accessor<T>
like it does with Route.useLoaderData
Screenshots or Videos

Platform
- Router / Start Version: 1.132.25
- OS: Windows
- Browser: Firefox
- Browser Version: 143
- Bundler: vite
- Bundler Version: 7.1.7
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels