How to give Image src dynamically in react js?

前端 未结 4 1587
后悔当初
后悔当初 2020-12-10 11:25

I am trying to give image name in src dynamically. I want to set image name dynamically using variable with path. but I am not able to set src correctly. I tried solutions o

4条回答
  •  感情败类
    2020-12-10 11:38

    You can still use require

    
    

    It's not recommended to manually add images to the public folder. See this answer here: https://stackoverflow.com/a/44158919/1275105

提交回复
热议问题