fix: locale selector + autosave race condition (#7891)
## Description Fixes a race condition where you could switch locales and have autosave trigger with old locale data. By adding the `key` to the `Document` component, we will ensure that the entire `Document` will be un-mounted and re-mounted between locale switches.
This commit is contained in:
@@ -280,6 +280,7 @@ export const Document: React.FC<AdminViewProps> = async ({
|
||||
initialData={data}
|
||||
initialState={formState}
|
||||
isEditing={isEditing}
|
||||
key={locale?.code}
|
||||
>
|
||||
{!RootViewOverride && (
|
||||
<DocumentHeader
|
||||
|
||||
Reference in New Issue
Block a user