This is my folder structure:
src
--Assets/
--pug.svg
--scss.svg
--Layouts/
--Skills/
--Skills.js
--App.js
My array
const skills = [
{
id: 1,
title: 'Pug',
image: 'url(../../Assets/pug.svg)'
},
{
id: 2,
title: 'SCSS',
image: 'url(../../Assets/scss.svg)'
}
In Skills.js I want to set the backgroundImage using React's inline styles, but it doesn't work. I don't get any error, just the backgroundImage doesn't show up.
{
skills.map(skill => (
<motion.div className='column' key={skill.id} variants={container}>
<div className='skill'>
<div className='skill-image' style={{ backgroundImage: `${skill.image}` }}/>
<h3>{skill.title}</h3>
</div>
</motion.div>
))
}
background-imageis attached toskill-imageelement, but simply not shown?