1

I'm having trouble trying to reroute onClose of a modal from Semantic UI React.

For some reason, Redirect to tag from react router dom does not trigger the redirect.

Here is the code:

        <Modal size='tiny' closeIcon defaultOpen onClose={() => <Redirect to='/'/>}>
</Modal>
Shaun Chua
  • 537
  • 1
  • 10
  • 24

1 Answers1

1
onClose={() => this.props.history.push('/')}

Try using history prop

Omar
  • 3,044
  • 2
  • 19
  • 31