Skip to content

Commit

Permalink
Create home.js
Browse files Browse the repository at this point in the history
  • Loading branch information
naveenbadhan27 committed Jul 19, 2021
1 parent 5571ef8 commit 66f701a
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions react1/component/home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React,{useState, useEffect} from 'react';
import {Link} from 'react-router-dom';
import Navbar from './navbar';

function Home(){

const [name, setName] = useState('');

function clickme(){
alert('hi '+name);
}

function clickmew(x){
alert(x);
}

return(
<div>
<Navbar />
<h1>Welcome to Home</h1>


<input type='text' name='' onChange={(event) => {setName(event.target.value)}} />

<button onClick={clickme}>Click</button>

<button onClick={() => clickmew('Hello')}>Click</button>

</div>
)
}

export default Home;

0 comments on commit 66f701a

Please sign in to comment.