🔥🔥 Show Name on Submit Button 🔥🔥

 vdsv

import React, { useState } from 'react';


const Form = () =>
{
    const [namesetName] = useState("");
    const [fullNamesetFullName] = useState(name);

    const changedText = (extract=>
    {
        console.log(extract.target.value);
        setName(extract.target.value)
    }

    const Upname = () =>
    {
        setFullName(name);
    }
    

    return(
        <>
        <div style={{marginTop150}}>
            <h1 style={textAlign'center'}}>Hello {fullName}</h1>
            <input 
                type="text" 
                style={{marginLeft : "875px"}} 
                placeholder="Enter Your Name" 
                onChange={changedText}
            />
            <br />
            <br />
            <button style={{marginLeft : "925px"}} onClick={Upname} >Submit</button>
        </div>
        </>
    );
}

export default Form;

dvdf


Comments

Popular Posts