Skip to content

RouteComponentProps error with react v17 and react-router-dom v5 #107

@edu-amr

Description

@edu-amr

Description

I'm using react v17 with react-router-dom v5 and I'm having a problem with imports and types, where type.d.ts sends a message saying "history is not defined" and The module' "react-router-dom" ' has no exported member 'RouteComponentProps'.ts(2305).

I saw that many are having the problem with the latest version, but I am having an error with an older version, I tried to use react v18 with RRD v5 but I had other problems.

Steps to reproduce

Follow steps described in documentation to reproduze a same reduce

  • React v17
  • React-router-dom v5

Expected result

React guards function return a component or router in page

Actual result

"type.d.ts sends a message saying "history is not defined" and The module' "react-router-dom" ' has no exported member 'RouteComponentProps'.ts(2305)."

Environment

  • OS: win 10
  • Browser and its version: [Chrome 115 on Windows 10]
  • React Router DOM version: v5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions