1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Update to React 18

This commit is contained in:
grafixeyehero 2024-06-02 20:58:11 +03:00
parent b5d6e37fb3
commit be891c3a98
36 changed files with 339 additions and 311 deletions

View file

@ -1,4 +1,4 @@
import React, { FunctionComponent, useCallback, useEffect, useMemo, useRef } from 'react';
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
import { useSearchParams } from 'react-router-dom';
import globalize from '../../../scripts/globalize';
@ -25,7 +25,7 @@ type ControllerProps = {
destroy: () => void;
};
const Home: FunctionComponent = () => {
const Home = () => {
const [ searchParams ] = useSearchParams();
const initialTabIndex = parseInt(searchParams.get('tab') ?? '0', 10);

View file

@ -6,6 +6,11 @@ import globalize from 'scripts/globalize';
import { DisplaySettingsValues } from '../types';
import { useDisplaySettings } from './useDisplaySettings';
type UpdateField = {
name: keyof DisplaySettingsValues;
value: string | boolean;
};
export function useDisplaySettingForm() {
const [urlParams] = useSearchParams();
const {
@ -21,7 +26,7 @@ export function useDisplaySettingForm() {
}
}, [formValues, loading, displaySettings]);
const updateField = useCallback(({ name, value }) => {
const updateField = useCallback(({ name, value }: UpdateField) => {
if (formValues) {
setFormValues({
...formValues,