Fix some React lifecycle and rendering errors that exist in build

This commit is contained in:
Gabe Kangas
2023-01-10 16:39:12 -08:00
parent e9d43492d0
commit d8a5380b7f
16 changed files with 85 additions and 102 deletions

View File

@@ -19,14 +19,22 @@ import styles from './UserDropdown.module.scss';
import { AppStateOptions } from '../../stores/application-state';
// Lazy loaded components
const Modal = dynamic(() => import('../../ui/Modal/Modal').then(mod => mod.Modal));
const Modal = dynamic(() => import('../../ui/Modal/Modal').then(mod => mod.Modal), {
ssr: false,
});
const NameChangeModal = dynamic(() =>
import('../../modals/NameChangeModal/NameChangeModal').then(mod => mod.NameChangeModal),
const NameChangeModal = dynamic(
() => import('../../modals/NameChangeModal/NameChangeModal').then(mod => mod.NameChangeModal),
{
ssr: false,
},
);
const AuthModal = dynamic(() =>
import('../../modals/AuthModal/AuthModal').then(mod => mod.AuthModal),
const AuthModal = dynamic(
() => import('../../modals/AuthModal/AuthModal').then(mod => mod.AuthModal),
{
ssr: false,
},
);
export type UserDropdownProps = {
@@ -58,9 +66,6 @@ export const UserDropdown: FC<UserDropdownProps> = ({ username: defaultUsername
);
const currentUser = useRecoilValue(currentUserAtom);
if (!currentUser) {
return null;
}
const { displayName } = currentUser;
const username = defaultUsername || displayName;