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 { createElement, useContext, useEffect } from 'react';
import { createElement, useContext, useLayoutEffect } from 'react';
import { useParams } from 'react-router-dom';
import List from '@mui/material/List';
import { useTranslation } from 'react-i18next';
@@ -46,7 +46,7 @@ export function SourceConfigure() {
const { t } = useTranslation();
const { setTitle, setAction } = useContext(NavBarContext);
useEffect(() => {
useLayoutEffect(() => {
setTitle(t('source.configuration.title'));
setAction(null);