Use "useLayoutEffect" for setting title and actions

This commit is contained in:
schroda
2024-09-26 15:33:22 +02:00
parent c72cf9a0ab
commit 70f8e36b6e
26 changed files with 54 additions and 54 deletions

View File

@@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { useContext, useEffect, useState } from 'react';
import { useContext, useEffect, useLayoutEffect, useState } from 'react';
import List from '@mui/material/List';
import ListItemText from '@mui/material/ListItemText';
import { fromEvent } from 'file-selector';
@@ -58,7 +58,7 @@ let backupRestoreId: string | undefined;
export function Backup() {
const { t } = useTranslation();
const { setTitle, setAction } = useContext(NavBarContext);
useEffect(() => {
useLayoutEffect(() => {
setTitle(t('settings.backup.title'));
setAction(null);