Created
June 4, 2020 16:20
-
-
Save dwalkr/d97a8495a33ffd766fdb726e0fae2fdf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const [data] = useForm({ | |
//... | |
loadInitialValues: editMode ? loadData : async () => content | |
}) | |
const layoutContent = useMemo(() => { | |
if (editMode && data.keys().length > 0) return data | |
return content | |
}, [editMode, content, data] | |
return <h1>{layoutContent.title}</h1> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment