Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
label,
fields,
values: valuesOnDisk,
}
)
/* eslint-disable-next-line react-hooks/rules-of-hooks */
const writeToDisk = React.useCallback(formState => {
cms.api.git.onChange!({
fileRelativePath: formState.values.fileRelativePath,
content: toMarkdownString(formState.values),
})
}, [])
/* eslint-disable-next-line react-hooks/rules-of-hooks */
useWatchFormValues(form, writeToDisk)
return [markdownRemark, form]
}
})
},
})
const writeToDisk = React.useCallback((formState) => {
cms.api.git.writeToDisk({
fileRelativePath: props.fileRelativePath,
content: JSON.stringify({
title: formState.values.title,
headline: formState.values.headline,
markdown: formState.values.markdown,
}),
})
}, [])
useWatchFormValues(form, writeToDisk)
return (
<>
),
},
]}
/>