mirror of
https://github.com/status-im/safe-react.git
synced 2025-02-18 20:46:29 +00:00
replace JSX.Element
with React.ReactElement
See: @Ferdaber's note at: https://github.com/typescript-cheatsheets/react-typescript-cheatsheet/blob/master/docs/advanced/types-react-ap.md > I discourage the use of most `...Element` types because of how black-boxy `JSX.Element` is. You should almost always assume that anything produced by `React.createElement` is the base type `React.ReactElement`.
This commit is contained in:
parent
b9262ffdf0
commit
1671136115
@ -42,7 +42,7 @@ interface Props {
|
|||||||
ethBalance?: string
|
ethBalance?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const AddressInfo = ({ ethBalance, safeAddress, safeName }: Props): JSX.Element => {
|
const AddressInfo = ({ ethBalance, safeAddress, safeName }: Props): React.ReactElement => {
|
||||||
return (
|
return (
|
||||||
<Wrapper>
|
<Wrapper>
|
||||||
<div className="icon-section">
|
<div className="icon-section">
|
||||||
|
@ -45,7 +45,7 @@ const typePlaceholder = (text: string, type: string): string => {
|
|||||||
return `${text} E.g.: ["first value", "second value", "third value"]`
|
return `${text} E.g.: ["first value", "second value", "third value"]`
|
||||||
}
|
}
|
||||||
|
|
||||||
const ArrayTypeInput = ({ name, text, type }: { name: string; text: string; type: string }): JSX.Element => (
|
const ArrayTypeInput = ({ name, text, type }: { name: string; text: string; type: string }): React.ReactElement => (
|
||||||
<TextareaField name={name} placeholder={typePlaceholder(text, type)} text={text} type="text" validate={validator} />
|
<TextareaField name={name} placeholder={typePlaceholder(text, type)} text={text} type="text" validate={validator} />
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ type Props = {
|
|||||||
placeholder: string
|
placeholder: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const InputComponent = ({ type, keyValue, placeholder }: Props): JSX.Element => {
|
const InputComponent = ({ type, keyValue, placeholder }: Props): React.ReactElement => {
|
||||||
if (!type) {
|
if (!type) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import InputComponent from './InputComponent'
|
|||||||
import { generateFormFieldKey } from '../utils'
|
import { generateFormFieldKey } from '../utils'
|
||||||
import { AbiItemExtended } from 'src/logic/contractInteraction/sources/ABIService'
|
import { AbiItemExtended } from 'src/logic/contractInteraction/sources/ABIService'
|
||||||
|
|
||||||
const RenderInputParams = (): JSX.Element => {
|
const RenderInputParams = (): React.ReactElement => {
|
||||||
const {
|
const {
|
||||||
meta: { valid: validABI },
|
meta: { valid: validABI },
|
||||||
} = useField('abi', { subscription: { valid: true, value: true } })
|
} = useField('abi', { subscription: { valid: true, value: true } })
|
||||||
|
@ -72,7 +72,7 @@ const openIconStyle = {
|
|||||||
color: secondary,
|
color: secondary,
|
||||||
}
|
}
|
||||||
|
|
||||||
const Advanced = (): JSX.Element => {
|
const Advanced = (): React.ReactElement => {
|
||||||
const classes = useStyles()
|
const classes = useStyles()
|
||||||
|
|
||||||
const columns = generateColumns()
|
const columns = generateColumns()
|
||||||
|
@ -17,7 +17,7 @@ const INITIAL_STATE = {
|
|||||||
showReceive: false,
|
showReceive: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
const SafeView = (): JSX.Element => {
|
const SafeView = (): React.ReactElement => {
|
||||||
const [state, setState] = useState(INITIAL_STATE)
|
const [state, setState] = useState(INITIAL_STATE)
|
||||||
const safeAddress = useSelector(safeParamAddressFromStateSelector)
|
const safeAddress = useSelector(safeParamAddressFromStateSelector)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user