piyush-eon / notezipper

Watch Full Tutorial for this App on YouTube
https://www.youtube.com/watch?v=IQXjO0t4XRM&list=PLKhlp2qtUcSYC7EffnHzD-Ws2xG-j3aYo
142 stars 574 forks source link

Note-Info Form not auto-populating on click on Edit #5

Closed JavaKaran closed 2 years ago

JavaKaran commented 2 years ago

After clickcing on edit button the note information is not auto populating with the information. I have checked with everything but it is working the same in every case

useEffect(() => {
    const fetching = async () => {
      const { data } = await axios.get(`/api/notes/${match.params.id}`);

      setTitle(data.title);
      setContent(data.content);
      setCategory(data.category);
      setDate(data.updatedAt);
    };

    fetching();
  }, [match.params.id, date]);
piyush-eon commented 2 years ago

Make sure your inputs are controlled, not uncontrolled.

CourageOI commented 2 years ago

I am still having the same issue. The get request from the useEffect isn't loading the note from the database