Closed clevernyyyy closed 4 years ago
Hi @clevernyyyy - you may need a fully qualified path for the image url. Have you tried that?
Additionally, are you using CreateReactApp?
Yes I am, which I know auto hashes names.
Have you tried passing thePicture
?
To what? This isn't proper formatting.
const events = [{
date: new Date(2013, 9, 27),
text: "Sed leo elit, pellentesque sit amet congue quis, ornare nec lorem.",
title: "The Picture",
imageUrl: thePicture
}]
Check out this file: https://github.com/aaron9000/react-image-timeline/blob/master/src/data.js
When served via CRA, this pattern seems to work in the example project.
Do you see errors in the browser by chance? I don't see anything wrong with the below:
const events = [{
date: new Date(2013, 9, 27),
text: "Sed leo elit, pellentesque sit amet congue quis, ornare nec lorem.",
title: "The Picture",
imageUrl: thePicture
}]
I can confirm this works:
import svg from './logo.svg';
const events = [
{
date: new Date(2013, 9, 27),
text: "Sed leo elit, pellentesque sit amet congue quis, ornare nec lorem.",
title: "Cairo, Egypt",
imageUrl: svg,
},
];
Woot! Thank you, Joe!
Gonna close this issue.
No problem @aaron9000 thanks for your work dude
I'm having trouble trying to use local images. Is that feasible?
This works in the
img
tag, but not in the events tag.