Full stack To Do App

Solution retrospective
I am wondering if I am meant if I have been sending data to my database correctly when considering React. I choose not to use useEffect here as the fetch request isn't effecting the component.
Is it right to not use it here?
const handleSubmit= (e)=>{
const item = {
id:Math.random()*1000,
text:inputText,
complete:false
}
e.preventDefault()
setNewItem([...newItem,item
])
setInputText('')
//custom fetch hook
UseFetch("/api/addOne", "POST", item) }
Plus any other feedback would be welcome
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Zachariah Kozlowski-Best's solution.
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord