title: How can I dispatch something with React / Redux?
body: <p>Here's what I have so far:</p>
  
  <pre><code>export default connect(
    (state) =&gt; ({
      search: state.search
    }),
    (dispatch) =&gt; ({
      onSearch: (location) =&gt; (q) =&gt; dispatch(actions.push(getUrlWithQS(location, { qs: { q } }))),
      onClipCardClick: (location) =&gt; (clip) =&gt; dispatch(actions.push(getUrlWithQS(location, { pathname: `/clips/${clip.id}` })))
    }),
    (stateProps, dispatchProps, ownProps) =&gt; ({
      ...stateProps,
      ...dispatchProps,
      ...ownProps,
      onSearch: dispatchProps.onSearch(ownProps.location),
      onClipCardClick: dispatchProps.onClipCardClick(ownProps.location)
    })
  )(Home)
  </code></pre>
  
  <p>I didn't write this (I inherited) it, so the <code>onSearch</code> apparently dispatches something and passes a new query? So what happens is the URL changes to <a href="http://localhost:5000/?q=whatever" rel="nofollow noreferrer">http://localhost:5000/?q=whatever</a></p>
  
  <p>How can I dispatch without changing the URL?</p>
  
  <p><strong>EDIT</strong></p>
  
  <pre><code>import { push, goBack } from 'react-router-redux'
  actions.push = push
  </code></pre>
  
  <p>And the component that triggers the <code>onSearch</code> looks like:</p>
  
  <pre><code>  onChange (e) {
      if(this.state.isMobile) {
        return this.props.onSubmit(e.target.value)
      }
  
      if(this.props.autoSearch) {
        this.props.onSubmit(e.target.value)
      }
  
      this.props.onAutocomplete(e.target.value)
      this.setState({
        value: e.target.value,
        selectedSearch: false
      })
  
    }
  </code></pre>