I’m developing a little website/portfolio on React.js and I’m having some issues to display images that are stored in a json file.
The console shows the files but we can’t see the images in the browser ! Can anyone lend me a hand please ?
Here’s my json file:
export const GaleriesData = [
{
id: 1,
tableaux: [
“../assets/img/galeries/aformaimediata/aformaimediata1.jpg”,
...
“../assets/img/galeries/aformaimediata/aformaimediata8.jpg”,
],
},
{
id: 2,
tableaux: [
“../assets/img/galeries/espiritoarte/espiritoarte1.jpg”,
...
“../assets/img/galeries/espiritoarte/espiritoarte10.jpg”,
],
},
];
And here’s my component:
import React, { useState } from ‘react’;
import FbImageGrid from ‘react-facebook-photo-grid’;
import { GaleriesData } from ‘../data/galeriesData.js’
const Galerie = (props) => {
const [currentGalerie] = useState(GaleriesData);
const galerie = currentGalerie[props.galerieNumber].tableaux;
return (
<div>
<FbImageGrid images={galerie} maxWidth={800} />
</div>
)
}
export default Galerie