firebaseui-web-react
firebaseui-web-react copied to clipboard
Buttons hiding when rendering two StyledFirebaseAuth components
I am using two StyledFirebaseAuth components, one for signing up and the other inside a modal for signing in. When the modal renders, the buttons in the modal (sign in with google, ms, email) disappear and render in the other StyledFirebaseAuth instead. When the modal closes, the buttons that had rendered behind the modal disappear.
Independently both these components work fine when they are not rendered simultaneously.
Are there known issues related to this?
I am wondering if I would be best off finding a way to stop rendering one component entirely when the other is being used
@AlexanderChiclana I think this is because this library uses a hard-coded id for the element it renders firebaseui into: https://github.com/firebase/firebaseui-web-react/blob/49f80b5d1548e4d4a2575e0e7f998e7148440405/src/FirebaseAuth.jsx#L21
https://github.com/firebase/firebaseui-web-react/blob/49f80b5d1548e4d4a2575e0e7f998e7148440405/src/FirebaseAuth.jsx#L118
https://github.com/firebase/firebaseui-web-react/blob/49f80b5d1548e4d4a2575e0e7f998e7148440405/src/FirebaseAuth.jsx#L82
Since the container always has the same id, it will likely cause issues if you render multiple at the same time. We should probably fix this in the library by using useRef instead of a hard-coded id.