I would like to know how to load the HTML form in the iframe in reactjs.
I have one form component that has all the input fields, and I want to load that form component in the iframe. I would like to know how I can do that.
const Form = () => {
return (
<form onSubmit={handleSubmit}>
<div>
<label htmlFor="name">Name</label>
<input
type="text"
id="name"
/>
</div>
<div>
<label htmlFor="email">Email</label>
<input type="email" id="email" />
</div>
<button>Submit</button>
</form>
);
};
export default Form;