Skip to content
New issue

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

useFetcher bindings #2

Open
tom-sherman opened this issue Dec 20, 2021 · 1 comment
Open

useFetcher bindings #2

tom-sherman opened this issue Dec 20, 2021 · 1 comment

Comments

@tom-sherman
Copy link
Owner

Ideally we should use a variant for the fetcher type, this may require wrapping the remix useFetcher and adding some small conversion functions.

@tom-sherman tom-sherman transferred this issue from tom-sherman/rescript-remix-template Jan 8, 2022
@youngkidwarrior
Copy link

youngkidwarrior commented Jul 7, 2022

Im trying to make a resource route from an unconventional route filename.

when I call Fetcher.load() I am getting an error where the data is looking in the unconventional route

my folder structure looks like this

app/
├── res-routes/
│   └── Root_FetchGuilds.js
│   └── Root_Index.js
├── routes/
│   └── index.js
│   └── fetchGuilds.js
└── root.res

routes/fetchGuilds.js imports from res-routes/Root_FetchGuilds

import { loader } from '~/res-routes/Root_FetchGuilds.js'

export { loader }

I am getting this error:

Error: Route "res-routes/Root_FetchGuilds" does not match URL "/fetchGuilds"

and the URL from useFetcher looks like this

/fetchGuilds?_data=res-routes/Root_FetchGuilds

when it should be
/fetchGuilds?_data=routes/fetchGuilds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants