Post URL:react-hooks-for-biggners


On change Number On React:

import styles from "../styles/Home.module.css";
import react,{useState} from "react";

const Home = () => {

const [counter, setcounter] = useState("pedro");
 

  let evalue = (event) =>{
    const newvalue=event.target.value;
    setcounter(newvalue);
  }

  return (
    <center>
      <div>
        {counter}
        <br />
        <input placeholder="enter Value.." onChange={evalue}/>
      </div>
    </center>
  );
};

export default Home;

On change Character with Input TextBox On React:

import react,{useState} from "react";

const Home = () => {

const [counter, setcounter] = useState("pedro");
 

  let evalue = (event) =>{
    const newvalue=event.target.value;
    setcounter(newvalue);
  }

  return (
    <center>
      <div>
        {counter}
        <br />
        <input placeholder="enter Value.." onChange={evalue}/>
      </div>
    </center>
  );
};

export default Home;