I guess this is more of a React question, but I'm quite stumped as to what's going on. I'm trying to listen to input changes and save the input value to database inside a useEffect function.
But for some reason it's giving me an error of TypeError: (0 , import_note.createNote) is not a function when I'm trying to call the createNote function inside useEffect. Could someone point me to a right direction or share any insights what am I misunderstanding about how useEffect works?
I recreated the situation in a blank Indie Stack to eliminate all other sideeffects.
https://github.com/kuldar/debug-remix/blob/main/app/routes/notes/new.jsx#L10-L14