Replies: 3 comments 10 replies
-
Are you redirecting as in the example? export async function action({ params }) {
await deleteContact(params.contactId);
return redirect("/"); <------
} |
Beta Was this translation helpful? Give feedback.
-
@sergiodxa could you give me an example of what do you mean? Let's say I have something like in the loader: return new Response('', {
status: 405,
statusText: 'Method Not Allowed',
headers: {
Allow: 'POST',
},
}); How would you "customize it"? |
Beta Was this translation helpful? Give feedback.
-
Just stumbled across this discussion as I've been refactoring a Remix.run app towards React Router 7 and I saw the error message for the first time. A difference between Remix and React Router that I have NOT seen mentioned in the upgrade guides so far, is that React Router needs an explicit loader function in a resource route (with the redirect). For Remix it was alright to only have an action function defined in the route. https://remix.run/docs/en/main/guides/resource-routes vs. https://reactrouter.com/how-to/resource-routes |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In the React Router Tutorial in the Deleting Records section it is described that in order to handle delete one can create a new
Route
:Is this the best/recommended way for handling such interactions?
I wonder because now we end up with a
Route
without an element. If the user navigates to/contacts/:contactId/destroy
then he will see an empty page. There will also be a warning logged:Beta Was this translation helpful? Give feedback.
All reactions