Remove hack for mounting JSON editor (#1565)

This commit is contained in:
Jon Koops 2021-11-17 12:45:29 +01:00 committed by GitHub
parent 15baa43cfb
commit d591e0d4a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -60,6 +60,7 @@ export const UserProfileTab = () => {
<Tabs
activeKey={activeTab}
onSelect={(_, key) => setActiveTab(key.toString())}
mountOnEnter
>
<Tab
eventKey="attributes"
@ -73,17 +74,11 @@ export const UserProfileTab = () => {
eventKey="jsonEditor"
title={<TabTitleText>{t("jsonEditor")}</TabTitleText>}
>
{/** The code editor needs to be rendered conditionally to prevent it from being initialized
* while the tab contents are hidden. If the contents of the tab are hidden then it
* might not initialize correctly.
*/}
{activeTab === "jsonEditor" && (
<JsonEditorTab
profiles={profiles}
onSave={onSave}
isSaving={isSaving}
/>
)}
</Tab>
</Tabs>
);