Controlled Component - React Js
App.js:
import React, {useState} from "react";
import './App.css'
function App()
{
const [val, setVal]=useState("");
return(
<div>
<h1>Controlled Component</h1>
<input type="text" value={val} onChange={(e)=>setVal(e.target.value)}/>
<h3>Text Value : {val}</h3>
</div>
)
}
export default App;
Comments
Post a Comment