Repository navigation
Replies: 1 comment
|
Hi @garrettsmith98, I converted this is issue into an discussion as the issues are more for CRA tooling internal issues. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
On my app react-task-tracker-app
my tasks will not show up or save onto my server with json
import { useState, useEffect } from 'react'
import Header from './componets/Header'
import Tasks from './componets/Tasks'
import AddTask from './componets/AddTask'
const App = () => {
const [showAddTask, setShowAddTask] = useState(false)
const [tasks, setTasks] = useState([])
useEffect(() => {
}
}, [])
const fetchTasks = async () => {
const res = await fetch('http://localhost:5000/tasks')
const data = await res.json()
}
const fetchTask = async (id) => {
const res = await fetch(
http://localhost:5000/tasks/${id})const data = await res.json()
}
const addTask = async (task) => {
}
const deleteTask = async (id) => {
}
const toggleReminder = async (id) => {
const taskToToggle = await fetchTask(id)
const updTask = {
...taskToToggle,
reminder: !taskToToggle.reminder
}
}
return (
<Header onAdd={() => setShowAddTask
(!showAddTask)} showAdd={showAddTask}
/>
{showAddTask && }
{
tasks.length > 0 ?
: 'No tasks to show'
}
);
}
export default App
All reactions