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:
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.