Closed forgyforg closed 2 years ago
You can pass a img tag like this :
<VerticalTimelineElement
icon={<img src="./logo.png" />}
>
Hmm now it's just showing an icon that I think indicates it can't find the file? The path is definitely correct, though.
If your image is not in the public folder, it's normal.
You need to import your image if you want to use it.
https://stackoverflow.com/questions/39999367/how-do-i-reference-a-local-image-in-react
How do you change the icons? You have
icon={<WorkIcon />}
, but what is WorkIcon? Does it matter what type of file/size? I'm new to react and still not sure how to add images so if you could tell me where the image needs to be included that would be great too!I put the timeline component and code in the src directory of my app and included this at the top of the file using timeline:
const logo = './logo.ico'
Then in each VerticalTimelineElement, I do this for icon propbut when I look at where logo should be on browser, I just see the a string with the logos path: