Skip to content

Instantly share code, notes, and snippets.

@dwalkr
Created June 4, 2020 16:20
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dwalkr/d97a8495a33ffd766fdb726e0fae2fdf to your computer and use it in GitHub Desktop.
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