Hi, In the React SDK - AuthProvider component moun...
# ask-a-descoper
b
Hi, In the React SDK - AuthProvider component mounts its children twice. Is that known?
I mean, is that the expected behavior?
g
Hey 👋 not sure I completely follow the question the application is managing the session state of the user (e.g. if the user is logged in) so I think it make sense that when the state is changing, any application that uses the state, it will render again can you give an example for what you mean by mounting twice?
b
Copy code
import { useEffect } from 'react'
import { AuthProvider } from '@descope/react-sdk'

function Inner() {
  useEffect(() => {
    console.log("Inner");
  }, []);

  return (
    <p>Inner</p>
  );
}

function App() {
  return (
    <>
      <AuthProvider projectId="...">
        <Inner />
      </AuthProvider>
    </>
  )
}

export default App
Here, I see "Inner" twice in the console
g
I will check that and update 🙂 thanks
b
Thanks