Okta-react with react router 6 keeps the LoginCallback mounted after redirect

I’m trying to upgrade to React Router v6. I’ve followed the guidance here okta-react/samples/routing/react-router-dom-v6/src at master · okta/okta-react · GitHub.
When I’m redirected back to my domain from the okta sign-in page, my LoginCallback component stays mounted, even though the path changes to “/”. The network tab shows that I’m successfully fetching a token from /oauth2/default/v1/token. When I manually refresh, everything is fine and I’m authenticated and can fetch data at secure routes and everything. I cannot figure out why this is hanging in this way. I’m on:

@okta/okta-auth-js”: “^7.0.0”,
@okta/okta-react”: “^6.6.0”,
“react-router-dom”: “^6.3.0”,
“react”: “^18.2.0”,
“react-dom”: “^18.2.0”,