I have been building off of the remix blog tutorial and ran into something interesting. I wanted to build the update form behavior with a reusable React form component, and it's resulted with a repeatable but weird behavior.
here's the github to clone: https://github.com/Huiet/remix-blog-tutorial
The issue is when navigating to the admin section and going into an existing 'post' to edit, if you select a different post it will not change/update the ui. What get's strange is when you reload the page, you are able to change posts and the ui updates as expected.
What could be causing this sort of behavior?
UPDATE:
The issue seemed to be around defaultValue on form input elements. What seems confusing is why things seem to work correctly when the user is starting on a route edit (ex: http://localhost:3000/posts/admin/my-first-post), refreshing, then changing to a different route seems to work.
one workaround I have found is wrapping form inputs with an element that uses a 'key' value, but I wonder if I am going against a remix approach.