From ee1501e674a920779804568acc6ebcee5722188c Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Sun, 12 May 2024 16:57:29 +0000 Subject: [PATCH] refactor: remove extra closing tags Components without children can be self-closed to avoid the unnecessary extra closing tag. In JSX, closing tags are required when the component has children example `...` and if there are no child component between these tags, then this component can be self closed using ``. It is recommended as it improves readability, and it is more compact to use self-closing for these types of components. --- src/components/DSA/arrays/ArrayVisualizations/index.tsx | 2 +- src/components/DSA/arrays/BubbleSortVisualization/index.tsx | 2 +- src/components/DSA/arrays/InsertionSortVisualization/index.tsx | 2 +- src/components/DSA/arrays/SelectionSortVisualization/index.tsx | 2 +- src/components/File/index.tsx | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/DSA/arrays/ArrayVisualizations/index.tsx b/src/components/DSA/arrays/ArrayVisualizations/index.tsx index 2d47e1cbc..f77f2c073 100644 --- a/src/components/DSA/arrays/ArrayVisualizations/index.tsx +++ b/src/components/DSA/arrays/ArrayVisualizations/index.tsx @@ -72,7 +72,7 @@ const ArrayVisualizations: React.FC = () => { key={index} className={`array-bar ${index === minIndex ? 'min-value' : ''} ${index === currentIndex ? 'current-value' : ''}`} style={{ height: `${value * 3}px` }} - > + /> ))} diff --git a/src/components/DSA/arrays/BubbleSortVisualization/index.tsx b/src/components/DSA/arrays/BubbleSortVisualization/index.tsx index 4fae73684..a271629e6 100644 --- a/src/components/DSA/arrays/BubbleSortVisualization/index.tsx +++ b/src/components/DSA/arrays/BubbleSortVisualization/index.tsx @@ -68,7 +68,7 @@ const BubbleSortVisualization: React.FC = () => { key={index} className={`array-bar ${comparingIndices.includes(index) ? 'comparing' : ''}`} style={{ height: `${value * 3}px` }} - > + /> ))} diff --git a/src/components/DSA/arrays/InsertionSortVisualization/index.tsx b/src/components/DSA/arrays/InsertionSortVisualization/index.tsx index 278c8367f..5a7f147aa 100644 --- a/src/components/DSA/arrays/InsertionSortVisualization/index.tsx +++ b/src/components/DSA/arrays/InsertionSortVisualization/index.tsx @@ -76,7 +76,7 @@ const InsertionSortVisualization: React.FC = () => { key={index} className={`array-bar ${index === currentIndex ? 'current-index' : index === minIndex ? 'min-index' : ''}`} style={{ height: `${value * 3}px`, transitionDelay: `${delay / 2}ms` }} - > + /> ))} diff --git a/src/components/DSA/arrays/SelectionSortVisualization/index.tsx b/src/components/DSA/arrays/SelectionSortVisualization/index.tsx index 5fdce30f5..c9cca19c6 100644 --- a/src/components/DSA/arrays/SelectionSortVisualization/index.tsx +++ b/src/components/DSA/arrays/SelectionSortVisualization/index.tsx @@ -69,7 +69,7 @@ const SelectionSortVisualization: React.FC = () => { key={index} className={`array-bar ${comparingIndices.includes(index) ? 'comparing' : ''}`} style={{ height: `${value * 3}px` }} - > + /> ))} diff --git a/src/components/File/index.tsx b/src/components/File/index.tsx index 5de1b2c4d..7aa9429cb 100644 --- a/src/components/File/index.tsx +++ b/src/components/File/index.tsx @@ -17,7 +17,7 @@ function File({ children, name }: { name: string; children: React.ReactNode }) { + /> {name}