2021年4月25日星期日

calling function to display html in javascript

I have this function in my spinner.js file:

import React from 'react';  import broomAndText from './ezgif.com-video-to-gif-3.gif';  import './spinner.css';            function myGif() {                return <html><body><div class="imgContainer"><img src={broomAndText} alt="broomAndText"/></div></body></html>        }            export default myGif;  

I want to call this function from here:

 } else {                                     myGif()            createCheckoutSession()           console.log("does not exist!")       }     });  

when I call myGif() like this, it does not display onto screen. how do i do this?

https://stackoverflow.com/questions/67259440/calling-function-to-display-html-in-javascript April 26, 2021 at 08:21AM

没有评论:

发表评论