Added missing types required for React 18 migration (#2034)

This commit is contained in:
Alex
2022-05-25 00:10:22 -05:00
committed by GitHub
parent 85c0e5eca2
commit 9b88dd6348
10 changed files with 16 additions and 9 deletions

View File

@@ -1014,8 +1014,9 @@ const ListObjects = ({ match, history }: IListObjectsProps) => {
[bucketName, dispatch, simplePath]
);
const onDrop = useCallback(
(acceptedFiles) => {
(acceptedFiles: any[]) => {
if (acceptedFiles && acceptedFiles.length > 0) {
let newFolderPath: string = acceptedFiles[0].path;
uploadObject(acceptedFiles, newFolderPath);

View File

@@ -17,7 +17,9 @@
import React from "react";
import { Box } from "@mui/material";
type Props = {};
type Props = {
children: React.ReactNode;
};
const ContentBox: React.FC<Props> = ({ children }) => {
return (

View File

@@ -22,6 +22,7 @@ type Props = {
title: string;
icon: React.ReactNode;
helpbox?: React.ReactNode;
children: React.ReactNode;
};
const FormLayout: React.FC<Props> = ({ children, title, helpbox, icon }) => {

View File

@@ -16,7 +16,9 @@
import React from "react";
type Props = {};
type Props = {
children: string;
};
const SectionH1: React.FC<Props> = ({ children }) => {
return (

View File

@@ -21,6 +21,7 @@ type Props = {
separator?: boolean;
actions?: React.ReactNode;
icon?: React.ReactNode;
children: string;
};
const SectionTitle: React.FC<Props> = ({

View File

@@ -13,7 +13,7 @@
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import React, { Component } from "react";
import React from "react";
import isString from "lodash/isString";
import { Link } from "react-router-dom";
import createStyles from "@mui/styles/createStyles";
@@ -44,7 +44,7 @@ const styles = () =>
interface IActionButton {
label?: string;
type: string | Component;
type: string | React.ReactNode;
onClick?: (id: string) => any;
to?: string;
valueToSend: any;

View File

@@ -96,7 +96,7 @@ const MenuItem = ({
);
const selectMenuHandler = useCallback(
(e) => {
(e: any) => {
onExpand(page.id);
setSelectedMenuItem(page.id);
page.onClick && page.onClick(e);

View File

@@ -149,7 +149,7 @@ const AddNotificationEndpoint = ({
};
const onValueChange = useCallback(
(newValue) => {
(newValue: IElementValue[]) => {
setValueArr(newValue);
},
[setValueArr]

View File

@@ -131,7 +131,7 @@ const EditConfiguration = ({
};
const onValueChange = useCallback(
(newValue) => {
(newValue:IElementValue[]) => {
setValueObj(newValue);
},
[setValueObj]

View File

@@ -178,7 +178,7 @@ const AddServiceAccount = ({ classes, match }: IAddServiceAccountProps) => {
>
<Box>
<SectionTitle icon={<ServiceAccountCredentialsIcon />}>
Create Service Account for {userName}
{`Create Service Account for ${userName}`}
</SectionTitle>
<form
noValidate