const BookList = () => {
const [bookList, setBookList] = useState([])
const addBook = (book) => {
setBookList([…bookList, book])
}
const Display=()=>{
return (
- {list}
{bookList.map((list) => (
))}
);
}
on submiting form only
const BookList = () => {
const [bookList, setBookList] = useState([])
const addBook = (book) => {
setBookList([…bookList, book])
}
const Display=()=>{
return (