From 65445acc2b7ac765c2066aa5635494a71d7f9c3d Mon Sep 17 00:00:00 2001 From: Ethan Standel Date: Tue, 16 Nov 2021 23:34:31 -0500 Subject: [PATCH 1/2] fix: allow dependents to utilize react-router-dom@latest with less specific import --- src/SecureRoute.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/SecureRoute.tsx b/src/SecureRoute.tsx index e4289401..301b1439 100644 --- a/src/SecureRoute.tsx +++ b/src/SecureRoute.tsx @@ -12,20 +12,20 @@ import * as React from 'react'; import { useOktaAuth, OnAuthRequiredFunction } from './OktaContext'; -import { Route, useRouteMatch, RouteProps } from 'react-router-dom'; +import * as ReactRouterDom from 'react-router-dom'; import { toRelativeUrl } from '@okta/okta-auth-js'; import OktaError from './OktaError'; const SecureRoute: React.FC<{ onAuthRequired?: OnAuthRequiredFunction; errorComponent?: React.ComponentType<{ error: Error }>; -} & RouteProps & React.HTMLAttributes> = ({ +} & ReactRouterDom.RouteProps & React.HTMLAttributes> = ({ onAuthRequired, errorComponent, - ...routeProps + ...routeProps }) => { const { oktaAuth, authState, _onAuthRequired } = useOktaAuth(); - const match = useRouteMatch(routeProps); + const match = ReactRouterDom.useRouteMatch(routeProps); const pendingLogin = React.useRef(false); const [handleLoginError, setHandleLoginError] = React.useState(null); const ErrorReporter = errorComponent || OktaError; @@ -86,7 +86,7 @@ const SecureRoute: React.FC<{ } return ( - ); From a0ab63ed4aefae291d51f39915cd7f7d05fd592e Mon Sep 17 00:00:00 2001 From: Jared Perreault Date: Thu, 27 Jan 2022 11:10:10 -0500 Subject: [PATCH 2/2] CHANGELOG update --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c3cd07c..8c102e6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### Bug Fixes - [#199](https://github.com/okta/okta-react/pull/199) Fixes okta-auth-js peer dependency error +- [#200](https://github.com/okta/okta-react/pull/200) Fixes: Typescript types when using `react-router-dom` v6 with `okta-react` # 6.4.1