mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix useRef TypeScript errors
This commit is contained in:
parent
57895e724c
commit
4952fc0119
8 changed files with 8 additions and 8 deletions
|
@ -10,7 +10,7 @@ type AlphaPickerProps = {
|
|||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
const AlphaPickerComponent: FunctionComponent<AlphaPickerProps> = ({ onAlphaPicked = () => {} }: AlphaPickerProps) => {
|
||||
const [ alphaPicker, setAlphaPicker ] = useState(null);
|
||||
const element = useRef(null);
|
||||
const element = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
setAlphaPicker(new AlphaPicker({
|
||||
|
|
|
@ -24,7 +24,7 @@ type ItemsArr = {
|
|||
const NewUserPage: FunctionComponent = () => {
|
||||
const [ channelsItems, setChannelsItems ] = useState([]);
|
||||
const [ mediaFoldersItems, setMediaFoldersItems ] = useState([]);
|
||||
const element = useRef(null);
|
||||
const element = useRef<HTMLDivElement>(null);
|
||||
|
||||
const getItemsResult = (items: ItemsArr[]) => {
|
||||
return items.map(item =>
|
||||
|
|
|
@ -31,7 +31,7 @@ const UserEditPage: FunctionComponent = () => {
|
|||
const [ authenticationProviderId, setAuthenticationProviderId ] = useState('');
|
||||
const [ passwordResetProviderId, setPasswordResetProviderId ] = useState('');
|
||||
|
||||
const element = useRef(null);
|
||||
const element = useRef<HTMLDivElement>(null);
|
||||
|
||||
const triggerChange = (select: HTMLInputElement) => {
|
||||
const evt = document.createEvent('HTMLEvents');
|
||||
|
|
|
@ -25,7 +25,7 @@ const UserLibraryAccessPage: FunctionComponent = () => {
|
|||
const [mediaFoldersItems, setMediaFoldersItems] = useState([]);
|
||||
const [devicesItems, setDevicesItems] = useState([]);
|
||||
|
||||
const element = useRef(null);
|
||||
const element = useRef<HTMLDivElement>(null);
|
||||
|
||||
const triggerChange = (select: HTMLInputElement) => {
|
||||
const evt = document.createEvent('HTMLEvents');
|
||||
|
|
|
@ -32,7 +32,7 @@ const UserParentalControl: FunctionComponent = () => {
|
|||
const [ accessSchedules, setAccessSchedules ] = useState([]);
|
||||
const [ blockedTags, setBlockedTags ] = useState([]);
|
||||
|
||||
const element = useRef(null);
|
||||
const element = useRef<HTMLDivElement>(null);
|
||||
|
||||
const populateRatings = useCallback((allParentalRatings) => {
|
||||
let rating;
|
||||
|
|
|
@ -23,7 +23,7 @@ type MenuEntry = {
|
|||
const UserProfilesPage: FunctionComponent = () => {
|
||||
const [ users, setUsers ] = useState([]);
|
||||
|
||||
const element = useRef(null);
|
||||
const element = useRef<HTMLDivElement>(null);
|
||||
|
||||
const loadData = () => {
|
||||
loading.show();
|
||||
|
|
|
@ -36,7 +36,7 @@ type SearchFieldsProps = {
|
|||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
const SearchFields: FunctionComponent<SearchFieldsProps> = ({ onSearch = () => {} }: SearchFieldsProps) => {
|
||||
const element = useRef(null);
|
||||
const element = useRef<HTMLDivElement>(null);
|
||||
|
||||
const getSearchInput = () => element?.current?.querySelector('.searchfields-txtSearch');
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ type SearchResultsRowProps = {
|
|||
}
|
||||
|
||||
const SearchResultsRow: FunctionComponent<SearchResultsRowProps> = ({ title, items = [], cardOptions = {} }: SearchResultsRowProps) => {
|
||||
const element = useRef(null);
|
||||
const element = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
cardBuilder.buildCards(items, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue