Skip to content

Commit 9a8b058

Browse files
author
Tim Roes
authored
Remount connector form on type switch (#19511)
1 parent f08b84f commit 9a8b058

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

airbyte-webapp/src/views/Connector/ConnectorCard/ConnectorCard.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ export const ConnectorCard: React.FC<ConnectorCardCreateProps | ConnectorCardEdi
172172
{additionalSelectorComponent}
173173
<div>
174174
<ConnectorForm
175+
// Causes the whole ConnectorForm to be unmounted and a new instance mounted whenever the connector type changes.
176+
// That way we carry less state around inside it, preventing any state from one connector type from affecting another
177+
// connector type's form in any way.
178+
key={selectedConnectorDefinition && Connector.id(selectedConnectorDefinition)}
175179
{...props}
176180
selectedConnectorDefinition={selectedConnectorDefinition}
177181
selectedConnectorDefinitionSpecification={selectedConnectorDefinitionSpecification}

airbyte-webapp/src/views/Connector/ConnectorForm/components/Property/LabelInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const Examples: React.FC<Pick<LabelInfoProps, "examples">> = ({ examples }) => {
4141
</h4>
4242
<div className={styles.exampleContainer}>
4343
{examplesArray.map((example) => (
44-
<span className={styles.exampleItem}>{example}</span>
44+
<span className={styles.exampleItem}>{String(example)}</span>
4545
))}
4646
</div>
4747
</div>

0 commit comments

Comments
 (0)