NA +91-8727899942 thecoderjob@gmail.com

CHAPTER - 37

Controlled Component

The component in which input value changed by state

Here's is the Code !!

import React,{useState} from "react"
function App() {
  const [val,setVal]=useState("")
   return (
    <div className="App">
      <h1>Controlled Component </h1>
      <input type="text" value={val} onChange={(e)=>setVal(e.target.value)} />
   <h1>{val}</h1>
    </div>
  );

}
export default  App;

Chapter 36

What is forwardRef

Previous chapter

Chapter 38

Uncontrolled Component

Next chapter

Get In Touch

NA

thecoderjob@gmail.com

+91-8727899942

Popular Links

© www.thecoderjob.com. All Rights Reserved.               Designed by HTML Codex