Skip to content

Commit

Permalink
Move react-router-dom as an explicit dependency
Browse files Browse the repository at this point in the history
While `react-router-dom` is not always required at runtime (only really requested when using `<SecureRoute />`), having it defined as a peer dependency raise issues for any user wanted to move to next majors of `react-router-dom` and not relying on `<SecureRoute />`.

Indeed for such users of `okta-react`, WebPack and other bundlers will fail to build the project because of the import of `useMatchRoute` not being part of the new major of `react-router-dom`. While it probably make a bit of sense whne you use `<SecureRoute />`, having your build broken because of it while you don't need it at all is strange. By moving the library as a clear dependency, `okta-react` wil always pull the right version and stop making user's builds fail.
  • Loading branch information
dubzzz committed Jan 28, 2022
1 parent a55b533 commit 652cb4a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@
},
"dependencies": {
"@babel/runtime": "^7.11.2",
"@okta/okta-auth-js": "^4.8.0"
"@okta/okta-auth-js": "^4.8.0",
"react-router-dom": "^5.1.0"
},
"peerDependencies": {
"@types/react-router-dom": "^5.1.6",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
"react-router-dom": ">=5.1.0"
"react-dom": ">=16.8.0"
},
"devDependencies": {
"@babel/cli": "^7.11.6",
Expand Down Expand Up @@ -104,4 +103,4 @@
"./",
"test/e2e/harness"
]
}
}

0 comments on commit 652cb4a

Please sign in to comment.