How to make image buttons in JSX?

Viewed 61388

This doesn't display an image, but still works as a button.

<button><img src={"./img/google.png"} /></button>

My folder setup is /user/img/google.png and /user/loginGoogle.jsx , so I don't think there is a problem with source

3 Answers

import logo from './logo.png'; // Tell webpack this JS file uses this image

// Import result is the URL of your image return ;

Related