Definitelytyped: react-router-dom outdated?

Created on 22 Jun 2019  路  6Comments  路  Source: DefinitelyTyped/DefinitelyTyped

If you know how to fix the issue, make a pull request instead.

  • [X] I tried using the @types/react-router-dom (4.3.4) package and had problems.
  • [X] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript (3.5.2)
  • [X] I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
  • [X] [Mention](https://github.com/blog/821-mention-somebody-they-re-notified) the authors (see Definitions by: in index.d.ts) so they can respond.

    • Authors: @huy-nguyen, @p-jackson, @johnnyreilly, @eps1lon

When using this package with "react-router-dom": "^5.0.1" and trying to use the activeClassName on a Link i get the following error:

TypeScript error in D:/Projects/MiFloraSwarm/MiFloraGateway/ClientApp/src/Header.tsx(8,14):
Type '{ children: string; to: string; className: string; activeClassName: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Link> & Readonly<LinkProps> & Readonly<{ children?: ReactNode; }>'.
  Property 'activeClassName' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Link> & Readonly<LinkProps> & Readonly<{ children?: ReactNode; }>'.  TS2322

Any chance we could get a update to 5.0.X?

All 6 comments

any update on this?

+1 on this, it would be great to have it

@AnderssonPeter Hey, switch to and you should be good to go. Let's close this issue.

There is no prop named activeClassName documented on Link. Did you mean NavLink which does have this prop documented and typed?

@jaysoo switch to what?

@eps1lon looks like you are right, thanks! (sorry for being confused)

Was this page helpful?
0 / 5 - 0 ratings