I
I
Ilya Lomaev2022-03-24 20:17:50
typescript
Ilya Lomaev, 2022-03-24 20:17:50

Why is the image not being inserted in TypeScript?

Good day!
I'm digging into the project on TS now, I need to make edits, before that I never worked with TS. Faced the following problem - it is necessary to replace the image on the site. In the code, all images are inserted like this:
623ca6c8cfbab848441723.jpeg
If I change src=${main_2} to ${name_of_my_image} - an error pops up, the image is not searched, although I put it in the same folder where the previous image was. What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Shipin, 2022-03-25
@alexshipin

<img class=${styles.image_2} src={`./ваш_путь/до/картинки`} alt='chip'/>

main_2 = "путь/до_картинки";
<img class=${styles.image_2} src=${main_2} alt='chip'/>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question