1

I have a images files but react is not take them ı cant import like that. Otherwise when i try

<img src={require("/FileAdress")} className="Logo" alt="logo" /> Nothings came and not recognized

whats the problem anyone help ? enter image description here

I have a logo folder inside image logo.png but ı cant see now

2 Answers 2

0

If you are using create-react-app you can add an image this way:

import Logo from 'path/to/logo.png';

<img src={Logo} className="Logo" alt="logo" />
Sign up to request clarification or add additional context in comments.

Comments

0

IF you are planning to deploy your react app later on with Netlify I would suggest you store your images in the public folder. That way then they can be easily accessed during development but they would also not cause any errors later on when deployment.

Example code:

<img
className='deleteBtn'
**src='/images/delete__btn.png'**
alt='Delete a product if admin'
/>

Example snapshot

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.