diff --git a/src/data-workspace/data-workspace.js b/src/data-workspace/data-workspace.js index a34f7ebaf..2e4d12585 100644 --- a/src/data-workspace/data-workspace.js +++ b/src/data-workspace/data-workspace.js @@ -81,7 +81,11 @@ export const DataWorkspace = ({ selectionHasNoFormMessage }) => { // We want to block initialization of form if in-flight // or else we might use stale data that won't be updated once request completes - if (initialDataValuesFetch.isFetching) { + if ( + initialDataValuesFetch.isFetching || + (!initialDataValuesFetch.isFetchedAfterMount && + !initialDataValuesFetch.isPaused) + ) { return ( diff --git a/src/data-workspace/form-wrapper.js b/src/data-workspace/form-wrapper.js index d44445304..eb968d719 100644 --- a/src/data-workspace/form-wrapper.js +++ b/src/data-workspace/form-wrapper.js @@ -1,5 +1,5 @@ import PropTypes from 'prop-types' -import React, { useLayoutEffect, useState } from 'react' +import React, { useEffect, useState } from 'react' import { useValueStore } from '../shared/index.js' function mapObject(input, callback) { @@ -35,7 +35,7 @@ export function FormWrapper({ children, dataValueSet, validFormKey }) { useValueStore((state) => state.getInitialDataValues())?.formKey === validFormKey - useLayoutEffect(() => { + useEffect(() => { if (setInitialDataValues && initialValues && validFormKey) { setInitialDataValues(initialValues, validFormKey) }