I don't know what's wrong always fs.exists is not a function...
setBannerEvent = feed => {
var fs = require("fs");
let file = feed !== null && feed !== undefined ? feed : "";
fs.exists(process.env.REACT_APP_BANNER_PATH + file, function(exists) {
if (exists === true) {
return (
<img
src={process.env.REACT_APP_BANNER_PATH + file}
className="img-avatar avatar-size"
width="80px"
height="80px"
alt={file}
style={{ paddingBottom: "0px" }}
/>
);
} else {
}
return console.log("hey");
});
};