0

What I want is (there are 3 buttons)

  1. user clicks on any one of the button the first letter of URL must changed to uppercase
  2. URL looks like, 'path/country= india, usa, australia'
  3. expected URL, 'path/country= India, Usa, Australia'
class App extends Component {
    constructor(props) {
        super(props);
        this.state = ['india','usa','australia']
    }

    let onTabChange = () => {
        window.history.replaceState(null,null,`${this.state.country.join(',')}`)
    }
    render() {
        return (
            <Switch>
                <Route path={`/India`} component={India} />
                <Route path={`/Usa`} component={Usa} />
                <Route path={`/Australia`} component={Australia} />
            </Switch>
        )}
    }
}
Sven Eberth
  • 2,943
  • 12
  • 21
  • 27
ABC
  • 1
  • 1
  • 1
    This question seems like a duplicate See https://stackoverflow.com/a/3354511/2635931 or https://stackoverflow.com/questions/3338642/updating-address-bar-with-new-url-without-hash-or-reloading-the-page – James Jul 08 '21 at 04:34

0 Answers0