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 { useParams } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { NavBarContext } from '@/components/context/NavbarContext.tsx';
@@ -67,7 +67,7 @@ export const Migrate = () => {
notifyOnNetworkStatusChange: true,
});
useEffect(() => {
useLayoutEffect(() => {
setTitle(name ?? sourceId ?? t('migrate.title'));
setAction(<GridLayouts gridLayout={gridLayout} onChange={setGridLayout} />);