Is it inside the body of your main App class? Maybe there’s some odd async behavior happening - could you try initializing it inside a useEffect hook and keeping a reference to it in useState? That’s what I generally do inside my useAuth hooks. See here for an example: