feat(app): reset form on load

This commit is contained in:
Lars Hampe 2024-11-10 07:26:20 +01:00
parent e98709d854
commit 9422eaed7e

View File

@ -76,8 +76,9 @@ const Component = () => {
useEffect(() => { useEffect(() => {
if (data) { if (data) {
mdxEditorRef.current?.setMarkdown(data.markdown) mdxEditorRef.current?.setMarkdown(data.markdown)
form.reset(data)
} }
}, [data]) }, [data, form])
if (error) { if (error) {
return ( return (