Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
241 views
in Technique[技术] by (71.8m points)

reactjs - How to toggle text with images in an array in react js

So I have an issue in my react code. I'm trying to toggle text with image in an array but when I do it, it's not toggling one item at a time. It changes from text to image but two things happened.

  1. All the items in the array was changed from text to images. What I want here is to change only the item that was clicked in the array.

  2. It's not toggling. My current code changes from text to image but on click again won't take it back together text.

I need help with these two issues

question from:https://stackoverflow.com/questions/65915981/how-to-toggle-text-with-images-in-an-array-in-react-js

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...