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
  • 705
  • 3
  • 13
  • 32

1 Answers1

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

Try using history prop

Omar
  • 3,401
  • 2
  • 23
  • 40