Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
Keep ids consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanahuckova committed Jan 29, 2024
1 parent d40a73a commit 5c545d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/VisualQueryBuilder/components/LabelFilterItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { uniqBy } from 'lodash';
import React, { useState } from 'react';
import React, { useRef, useState } from 'react';
import { v4 } from 'uuid';

import { SelectableValue, toOption } from '@grafana/data';
Expand Down Expand Up @@ -71,7 +71,7 @@ export function LabelFilterItem({
};

const isConflicting = isConflictingLabelFilter(item, items);
const id = v4();
const { current: id } = useRef(v4());

return (
<div data-testid="visual-query-builder-dimensions-filter-item">
Expand Down
4 changes: 2 additions & 2 deletions src/VisualQueryBuilder/components/OperationEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, cx } from '@emotion/css';
import React, { useEffect, useState } from 'react';
import React, { useEffect, useRef, useState } from 'react';
import { Draggable, DraggableProvided } from 'react-beautiful-dnd';
import { v4 } from 'uuid';

Expand Down Expand Up @@ -49,7 +49,7 @@ export function OperationEditor<T extends VisualQuery>({
}: Props<T>) {
const def = queryModeller.getOperationDefinition(operation.id);
const shouldFlash = useFlash(flash);
const id = v4();
const { current: id } = useRef(v4());

const theme = useTheme2();
const isConflicting = isConflictingOperation ? isConflictingOperation(operation, query.operations) : false;
Expand Down

0 comments on commit 5c545d0

Please sign in to comment.