Chap03 -> Handling events -> Handling an input change event
parent
e3810cc810
commit
27421824c7
|
@ -1,13 +1,23 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { UserIcon } from './Icons';
|
import { UserIcon } from './Icons';
|
||||||
|
|
||||||
export const Header = () => (
|
export const Header = () => {
|
||||||
|
const handleSearchInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
console.log(e.currentTarget.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
<div>
|
<div>
|
||||||
<a href="./">Q & A</a>
|
<a href="./">Q & A</a>
|
||||||
<input type="text" placeholder="Search ..." />
|
<input
|
||||||
|
type="text"
|
||||||
|
placeholder="Search ..."
|
||||||
|
onChange={handleSearchInputChange}
|
||||||
|
/>
|
||||||
<a href="./signin">
|
<a href="./signin">
|
||||||
<UserIcon />
|
<UserIcon />
|
||||||
<span>Sign In</span>
|
<span>Sign In</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in New Issue