Created
September 23, 2022 04:34
-
-
Save nsdevaraj/9b7769d533f379b43c4a306ba79737f9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useRef, useState } from "react"; | |
import "./Welcome.css"; | |
export function Welcome(props) { | |
const [srcURL, setsrcURL] = useState("https://www.google.com"); | |
const handleSubmit = () => { | |
setsrcURL(srcURL); | |
}; | |
return ( | |
<div className="App"> | |
<input type="text" | |
onChange={(e) => setsrcURL(e.target.value)}></input> | |
<button type="button" onClick={handleSubmit}> | |
Submit | |
</button> | |
<iframe | |
title="myBook" | |
src={srcURL} | |
height="720" | |
width="1280" | |
sandbox='allow-scripts allow-modal' | |
frameBorder="0" | |
scrolling="no" | |
allowFullScreen={true} | |
></iframe> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment