You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
802 B
31 lines
802 B
import React from "react";
|
|
import ReactDOM from "react-dom/client";
|
|
|
|
function SampleForm() {
|
|
return (
|
|
<div>
|
|
<h1>Hello, this is a sample form made in react !</h1>
|
|
<form action="result" method="POST">
|
|
<label>your name: </label>
|
|
<input type="text" id="name" name="name"/>
|
|
<label>your password: </label>
|
|
<input type="password" id="password" name="password"/>
|
|
<input type="submit" value="click me!"/>
|
|
</form>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export function render(args: any) {
|
|
const root = ReactDOM.createRoot(
|
|
document.getElementById('root') as HTMLElement
|
|
);
|
|
root.render(
|
|
<React.StrictMode>
|
|
<SampleForm />
|
|
</React.StrictMode>
|
|
);
|
|
}
|
|
|
|
|