简体   繁体   中英

Property 'src' does not exist on type 'HTMLElement'

I cant show my Image because of this error on the src property, how do I declare this correctly?

import { Typography } from '@material-ui/core';
import styled from 'styled-components'

const Product = ({item}:any) => {
    return (
        <Container>
            <Circle/>
            <Image src={item.imagem}/>
            <Typography>
                {item.nome}
            </Typography>

        </Container>
    )
}

export default Product;``

Try this

<Box component="img" src={item.imagem} />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM