import React, { useState } from "react"; import { useSelector, useDispatch } from "react-redux"; import { add_todo, select_todos } from "../features/todo/reducer"; export function Reducer() { const my_todos = useSelector(select_todos); const dispatch = useDispatch(); const [new_text, set_new_text] = useState(""); const [new_done, set_new_done] = useState(false); const [new_priority, set_new_priority] = useState("Low"); function handle_exit_modal() { // https://stackoverflow.com/questions/27826381/clearing-form-input-fields-in-bootstrap $("form").get(0).reset(); // Reset form set_new_text(""); set_new_done(false); set_new_priority("Low"); console.log("CLEANED."); } return ( <>
# | Name | Priority | Due Date | Actions |
---|---|---|---|---|
|
{item.text} | {item.priority} | {item.due_date} |
|