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:
parent
b5d6e37fb3
commit
be891c3a98
36 changed files with 339 additions and 311 deletions
|
@ -1,11 +1,21 @@
|
|||
import classNames from 'classnames';
|
||||
import React, { type DetailedHTMLProps, type InputHTMLAttributes, useState, useCallback, forwardRef } from 'react';
|
||||
import React, {
|
||||
type DetailedHTMLProps,
|
||||
type InputHTMLAttributes,
|
||||
useState,
|
||||
useCallback,
|
||||
forwardRef
|
||||
} from 'react';
|
||||
|
||||
import './emby-input.scss';
|
||||
|
||||
interface InputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
|
||||
id: string,
|
||||
label?: string
|
||||
interface InputProps
|
||||
extends DetailedHTMLProps<
|
||||
InputHTMLAttributes<HTMLInputElement>,
|
||||
HTMLInputElement
|
||||
> {
|
||||
id: string;
|
||||
label?: string;
|
||||
}
|
||||
|
||||
const Input = forwardRef<HTMLInputElement, InputProps>(
|
||||
|
@ -13,7 +23,7 @@ const Input = forwardRef<HTMLInputElement, InputProps>(
|
|||
const [isFocused, setIsFocused] = useState(false);
|
||||
|
||||
const onBlurInternal = useCallback(
|
||||
(e) => {
|
||||
(e: React.FocusEvent<HTMLInputElement, Element>) => {
|
||||
setIsFocused(false);
|
||||
onBlur?.(e);
|
||||
},
|
||||
|
@ -21,7 +31,7 @@ const Input = forwardRef<HTMLInputElement, InputProps>(
|
|||
);
|
||||
|
||||
const onFocusInternal = useCallback(
|
||||
(e) => {
|
||||
(e: React.FocusEvent<HTMLInputElement, Element>) => {
|
||||
setIsFocused(true);
|
||||
onFocus?.(e);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue