import React, { useState } from "react"; import { useSelector, useDispatch } from "react-redux"; import { set_filters, refresh_filtered_todos } from "../features/todo/reducer"; export function Search() { const dispatch = useDispatch(); const [search_name, set_search_name] = useState(""); const [search_priority, set_search_priority] = useState("All"); const [search_state, set_search_state] = useState("All"); function handle_search() { dispatch( set_filters({ name: search_name, priority: search_priority, state: search_state, }) ); dispatch(refresh_filtered_todos()); } return (
Name set_search_name(e.target.value)} >
); }