Skip to content

Commit

Permalink
Review: Comment code for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
WiNloSt committed Feb 2, 2024
1 parent 35029f0 commit 2b8172c
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,19 @@ export const StaticEmbedSetupPane = ({
onClick={() => setActiveTab(TABS.Appearance)}
>{t`Appearance`}</Tabs.Tab>
</Tabs.List>
{/**
* Please do not add more than one `Tabs.Panel` here.
*
* The reason there is only one `Tabs.Panel` is because I don't want
* the iframe (rendered inside `PreviewPane`) to be re-mounted when
* changing tabs. Otherwise, the preview will be reloaded
* every time we change tabs which makes it hard for users to see
* the preview while editing settings.
*
* This is because React will unmount everything
* when you change to a different tab since they're all rendered inside
* different `Tabs.Panel` if you were to use it as Mantine suggests.
*/}
<Tabs.Panel value={activeTab}>
{activeTab === TABS.Overview ? (
<OverviewSettings
Expand Down

0 comments on commit 2b8172c

Please sign in to comment.