Okta-react 2.0 migration SecureRoute issues

We are following the migration steps for okta-react outlined in the README provided by okta as we upgrade from 1.x to 2.x. We are now noticing some strange behavior with SecureRoute. We wrap our entire secured application with:

<SecureRoute component={AuthenticatedPages}/>

Inside there we have an additional switch with more SecureRoute’s. We notice that anytime we switch routes within the Authenticated portion of our application, that the AuthenticatedPages component is totally unmounting and re-mounting, causing all state to be lost and executing functionality that previously only executed the first time that the authenticated area loaded/mounted.

Any insight?

I did notice that if I switch that parent component from a SecureRoute to just Route then it does seem to alleviate the issue a bit since all the child routes are SecureRoute’s. Not sure if this the way to go though with this.

I believe this also could be related to https://github.com/okta/okta-oidc-js/issues/777

any guidance here would be greatly appreciated! am willing to talk it through as well!