0

I have stored the image name in local storage. The question is how to display image in reactjs.

1
  • how did you store them ? can you show the corresponding code please ? Commented Oct 31, 2019 at 15:00

1 Answer 1

2
const url = localStorage.getItem('imageName')

<img className="attached_image" src={url} alt="my upload" />

Get your image name from local storage and save its value in a variable which you can use next in img tag.

Hope this helps.

Sign up to request clarification or add additional context in comments.

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.