Skip to content

Instantly share code, notes, and snippets.

@nsdevaraj
Created September 23, 2022 04:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nsdevaraj/9b7769d533f379b43c4a306ba79737f9 to your computer and use it in GitHub Desktop.
Save nsdevaraj/9b7769d533f379b43c4a306ba79737f9 to your computer and use it in GitHub Desktop.
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