0

With react-router I can use the Link element to create links which are natively handled by react router.

I see internally it calls this.context.transitionTo(...).

I want to do a navigation. Not from a link, but from a dropdown selection (as an example). How can I do this in code? What is this.context?

I saw the Navigation mixin, but can I do this without mixins?

  • Are you not able to at least update to `react-router-dom@5`? You could use the `history` object and issue an imperative navigation. Actually NM, RRDv4 has access to `history` it seems. V4 and v5 are basically the same version, but I suggest *strongly* you should bump to v5 if you can. Please edit your post to share a [mcve] so we can see what your code is doing. – Drew Reese Aug 18 '22 at 18:37
  • It seems that https://stackoverflow.com/a/42124328/8690857 might be what you are looking for. – Drew Reese Aug 18 '22 at 18:44

0 Answers0