Reputation: 1
this is now
http://localhost:8001/components/button/
I want to
http://localhost:8001/components/button/?theme=dark
I used
browserHistory.push({
pathname: '',
query: {theme: dark},
})
and
browserHistory.push({
pathname: 'components/button',
query: {theme: dark},
})
and
browserHistory.push({
pathname: 'button',
query: {theme: dark},
})
All failed.
How can i do? Can you help me, thank you!
Upvotes: 0
Views: 71
Reputation: 385
You can use the push
method as:
browserHistory.push({
pathname: '/components/button',
search: '?theme=dark'
})
or simple as:
browserHistory.push('/components/button?theme=dark')
Upvotes: 0
Reputation: 4938
You could just use a string literal
and push onto history.
browserHistory.push(`components/button?theme=${dark}`)
Upvotes: 1