I am trying to set a timer to change the img src within reactbut it seems like this is not working.I saw that to write javascript we need to enclose it withing braces I did that but its still not helping. Code:-
class Default extends Component{
render() {
return (
<div>
<Grid.Row style={{height: '250px',margin:'-10px'}} className="adbanner">
<input id="ad" type="image" src={ad1} style={{position:'absolute',height:'50%',width:'100%'}}></input>
{
setTimeout(myFunction, 3000)
myFunction{
document.getElementById("ad").src="ad2";
}
}
</Grid.Row>
</div>
);
}
}
export default Default;