Ad
Using React-router History To Change Path Adds ? Before #
I'm using react router in my redux web app when i try to update the route using
this.props.history.push('/route')
It adds a ? to the address like so
https://website.com/?#/route
When it should look like this
https://website.com/#/route
This causes my single page application to reload.
Things i tried:
- upgrading react router to latest (2.0.1, currently using 1.0.3) didn't help
- we're using hash history, switching to browser history didn't help
Ad
Answer
Is it because you're using <form>
with React, and it's submitting a form.
See this answer for a better explanation: https://stackoverflow.com/a/32570827/5498949
Ad
source: stackoverflow.com
Related Questions
- → Import statement and Babel
- → should I choose reactjs+f7 or f7+vue.js?
- → Uncaught TypeError: Cannot read property '__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' of undefined
- → .tsx webpack compile fails: Unexpected token <
- → React-router: Passing props to children
- → ListView.DataSource looping data for React Native
- → React Native with visual studio 2015 IDE
- → Can't test submit handler in React component
- → React + Flux - How to avoid global variable
- → Webpack, React & Babel, not rendering DOM
- → How do I determine if a new ReactJS session and/or Browser session has started?
- → Alt @decorators in React-Native
- → How to dynamically add class to parent div of focused input field?
Ad