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 { useState } from "react";
|
||||||
import PersonList from "./components/PersonList";
|
import PersonList from "./components/PersonList";
|
||||||
|
|
||||||
|
const SearchArea = ({ onChangeHandler }) => {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
search name: <input onChange={onChangeHandler} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
const [persons, setPersons] = useState([
|
const [persons, setPersons] = useState([
|
||||||
{ name: "Arto Hellas", number: 123 },
|
{ name: "Arto Hellas", number: 123 },
|
||||||
|
|
@ -40,9 +48,7 @@ const App = () => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h2>Phonebook</h2>
|
<h2>Phonebook</h2>
|
||||||
<div>
|
<SearchArea onChangeHandler={handleSearchChange} />
|
||||||
search name: <input onChange={handleSearchChange} />
|
|
||||||
</div>
|
|
||||||
<h3>Add new</h3>
|
<h3>Add new</h3>
|
||||||
<form onSubmit={handleOnSubmit}>
|
<form onSubmit={handleOnSubmit}>
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue