extract search area
This commit is contained in:
parent
fe840d486f
commit
6ae16c9b9a
1 changed files with 9 additions and 3 deletions
|
|
@ -1,6 +1,14 @@
|
|||
import { useState } from "react";
|
||||
import PersonList from "./components/PersonList";
|
||||
|
||||
const SearchArea = ({ onChangeHandler }) => {
|
||||
return (
|
||||
<div>
|
||||
search name: <input onChange={onChangeHandler} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const App = () => {
|
||||
const [persons, setPersons] = useState([
|
||||
{ name: "Arto Hellas", number: 123 },
|
||||
|
|
@ -40,9 +48,7 @@ const App = () => {
|
|||
return (
|
||||
<div>
|
||||
<h2>Phonebook</h2>
|
||||
<div>
|
||||
search name: <input onChange={handleSearchChange} />
|
||||
</div>
|
||||
<SearchArea onChangeHandler={handleSearchChange} />
|
||||
<h3>Add new</h3>
|
||||
<form onSubmit={handleOnSubmit}>
|
||||
<div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue