Skip to content

Commit

Permalink
Add keys to UseField to ensure unmount
Browse files Browse the repository at this point in the history
When swapping between the Custom Query and EQL rule types, we want to
ensure that the corresponding input component coming from UseField fully
unmounts and remounts with the new component.
  • Loading branch information
rylnd committed Sep 14, 2020
1 parent 3759011 commit 35b00cd
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ const StepDefineRuleComponent: FC<StepDefineRuleProps> = ({
/>
{isEqlRule(ruleType) ? (
<UseField
key="EqlQueryBar"
path="queryBar"
component={EqlQueryBar}
componentProps={{
Expand All @@ -243,6 +244,7 @@ const StepDefineRuleComponent: FC<StepDefineRuleProps> = ({
/>
) : (
<UseField
key="QueryBarDefineRule"
path="queryBar"
config={{
...schema.queryBar,
Expand Down

0 comments on commit 35b00cd

Please sign in to comment.