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
6.4.1
Create a browser router with a basename, and add a route with an action and a form:
index.js:
const router = createBrowserRouter([ { path: '/', element: <App />, action: action }, ], { basename: 'foo' })
app.js:
function action({ params }) { console.log('foo') } function App() { return (<Form method='post'> <button type='submit'>submit</button> </Form>) }
The form posts to '/' instead of 'foo/'
A work around is specifying the action path with the basename:
{ /* other code */ } <Form method='post' action ='foo/'> <button type='submit'>submit</button> </Form> { /* other code */}
The expected behaviour is that the basename will be added before the action url of the form (according to the docs this is the current path)
The actual behaviour is that the path to the route is evaluated without taking the basename into account.
The text was updated successfully, but these errors were encountered:
I think this is a dup of #9347 which was fixed in 6.4.2. Please re-open if it's still not working for you!
6.4.2
Sorry, something went wrong.
No branches or pull requests
What version of React Router are you using?
6.4.1
Steps to Reproduce
Create a browser router with a basename, and add a route with an action and a form:
index.js:
app.js:
The form posts to '/' instead of 'foo/'
A work around is specifying the action path with the basename:
Expected Behavior
The expected behaviour is that the basename will be added before the action url of the form (according to the docs this is the current path)
Actual Behavior
The actual behaviour is that the path to the route is evaluated without taking the basename into account.
The text was updated successfully, but these errors were encountered: