We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://reactrouter.com/how-to/fetchers#loading-data
In this doc, search-users.tsx is defined as a resource route with no default export.
search-users.tsx
In the example here, it calls import type { Search } from "./search-users";, however there is no export called Search and therefore this fails.
import type { Search } from "./search-users";
Search
To get the type inference to work, I did this based on inspecting the generated types
import type { Info } from "../routes/+types/location_search"
Then inside the component
const fetcher = useFetcher<Info["loaderData"]>();
This works as expected, but not sure if this is the correct pattern to use
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe what's incorrect/missing in the documentation
https://reactrouter.com/how-to/fetchers#loading-data
In this doc,
search-users.tsx
is defined as a resource route with no default export.In the example here, it calls
import type { Search } from "./search-users";
, however there is no export calledSearch
and therefore this fails.To get the type inference to work, I did this based on inspecting the generated types
import type { Info } from "../routes/+types/location_search"
Then inside the component
const fetcher = useFetcher<Info["loaderData"]>();
This works as expected, but not sure if this is the correct pattern to use
The text was updated successfully, but these errors were encountered: