ReactJS and images in public folder

后端 未结 7 1605
北恋
北恋 2020-11-30 01:15

Im new in ReactJS and I want to import images in a component. These images are inside of the public folder and I do not know how to access the folder from the react componen

7条回答
  •  长情又很酷
    2020-11-30 01:42

    You don't need any webpack configuration for this..

    In your component just give image path. By default react will know its in public directory.

    image
    

提交回复
热议问题