score:1

Accepted answer
import imageName from './images/img-9.jpg';
<img src={imageName} />

score:0

../../assets/images/img-9.jpg

score:0

const { src, text, label, path } = props

    // How I needed a dinamic solution for reuse the component, here i assign the src value and complete path to a const.
    //IMPORTANT: It is an object so we have to access to default property
    const imgSrc = require(`../../assets/images/${src}`).default

    return (
        <>
            <li className="cards__item">
                <Link className="cards__item__link" to={path}>
                    <figure className="cards__item__pic-wrap" data-category={label}>
                        <img src={imgSrc} alt="Travel" className="cards__item__img" />
                    </figure>
                    <div className="cards__item__info">
                        <h5 className="cards__item__text">{text}</h5>
                    </div>
                </Link>
            </li>
        </>
    )

score:0

.name:after {content: url('assets/images/edit_icon.svg');}

Related Query

More Query from same tag