12

react-router and react-router-dom are two separate npm packages where one extends the other. react-router contains the base logic while react-router-dom bind this logic to the web and is the package that is actually used in a typical React project. There is also the react-router-native package for React Native which is rarely used and has 32k weekly downloads compared to 4.2 million for react-router-dom. Both versions are simply called "React Router" in their docs.

What is the best way to deal with the associated tags on Stack Overflow?

Though technically different, the and are essentially used as synonyms. Virtually every question on has to do with the web package rather than the native one. I would like some canonicalization here.

8
  • 15
    Leave it. The React Native package isn't as popular, but it's still it's own thing and it may get more popular over time. Commented Mar 21, 2021 at 10:45
  • 4
    @Jared one option would be to keep react-router-dom and react-router-native as the two tags and redirect react-router to react-router-dom. Commented Mar 21, 2021 at 16:10
  • 1
    I could image that to lead to questions getting tagged as react-router-dom and react-router-native at the same time because people would tag them as react-router (because clearly that is part of it, with react-router-native inheriting from it) and react-router-native. Commented Mar 22, 2021 at 9:59
  • 3
    be careful with the synonym, there are questions tagged with both [react-native] and [react-router] they should probably be first retagged to [react-native] [react-native-router]
    – Lino
    Commented Mar 22, 2021 at 12:35
  • 2
    @Lino Thanks for the link. It actually highlights quite a lot of mistags which need to be manually fixed! Many are web codes which should not have the [react-native] tag. Others are about [react-navigation] which is a totally separate package from [react-router]. Commented Mar 22, 2021 at 15:38
  • 1
    Good question. I will typically add react-router-dom|react-router-native to these questions as it is the more specific tag, and leave the more general react-router since it has more widespread visibility. I totally agree when used together like this they are basically synonymous and redundant. Very rarely have I come across a core-specific react-router-only question. I'm honestly a bit more concerned about more easily identifying the react-router-dom versions as there are many breaking changes between v5 and v6, though this may be an entirely different conversation.
    – Drew Reese
    Commented Mar 22, 2021 at 16:12
  • I've gone through about 5 pages of the posts linked by @Lino with both react-native and react-router. There are a handful that warrant both tags but 90-95% are mistagged and need one (occasionally both) of those tags removed. There is another bad pairing react-router and react-navigation with 104 questions. These are two separate libraries that would never be used in the same project so unless the user is asking about the differences between them then one of the tags is a mistake. Commented Mar 27, 2021 at 20:05
  • Another tag to add to the cleanup: react-routing has 59 questions, most of which should be tagged with react-router instead. Though there are a few that genuinely have nothing to do with the react-router package. Commented Apr 18, 2021 at 5:41

0

You must log in to answer this question.

Browse other questions tagged .