Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
useEffect(() => {
if (config === prevConfig.current) {
return
}
if (
config.initialValues &&
!initialValuesEqual(
config.initialValues,
prevConfig.current.initialValues
)
) {
form.initialize(config.initialValues)
}
configOptions.forEach(key => {
if (key !== 'initialValues' && config[key] !== prevConfig.current[key]) {
form.setConfig(key, config[key])
}
})
prevConfig.current = config
})