Skip to content

Commit ee1501e

Browse files
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 `<MyComponent>...</MyComponent>` and if there are no child component between these tags, then this component can be self closed using `<MyComponent />`. It is recommended as it improves readability, and it is more compact to use self-closing for these types of components.
1 parent 497b6a5 commit ee1501e

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

src/components/DSA/arrays/ArrayVisualizations/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const ArrayVisualizations: React.FC = () => {
7272
key={index}
7373
className={`array-bar ${index === minIndex ? 'min-value' : ''} ${index === currentIndex ? 'current-value' : ''}`}
7474
style={{ height: `${value * 3}px` }}
75-
></div>
75+
/>
7676
))}
7777
</div>
7878
</div>

src/components/DSA/arrays/BubbleSortVisualization/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const BubbleSortVisualization: React.FC = () => {
6868
key={index}
6969
className={`array-bar ${comparingIndices.includes(index) ? 'comparing' : ''}`}
7070
style={{ height: `${value * 3}px` }}
71-
></div>
71+
/>
7272
))}
7373
</div>
7474
</div>

src/components/DSA/arrays/InsertionSortVisualization/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const InsertionSortVisualization: React.FC = () => {
7676
key={index}
7777
className={`array-bar ${index === currentIndex ? 'current-index' : index === minIndex ? 'min-index' : ''}`}
7878
style={{ height: `${value * 3}px`, transitionDelay: `${delay / 2}ms` }}
79-
></div>
79+
/>
8080
))}
8181
</div>
8282
</div>

src/components/DSA/arrays/SelectionSortVisualization/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const SelectionSortVisualization: React.FC = () => {
6969
key={index}
7070
className={`array-bar ${comparingIndices.includes(index) ? 'comparing' : ''}`}
7171
style={{ height: `${value * 3}px` }}
72-
></div>
72+
/>
7373
))}
7474
</div>
7575
</div>

src/components/File/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function File({ children, name }: { name: string; children: React.ReactNode }) {
1717
<path
1818
fillRule="evenodd"
1919
d="M7.5 5L10 7.5 7.5 10l-.75-.75L8.5 7.5 6.75 5.75 7.5 5zm-3 0L2 7.5 4.5 10l.75-.75L3.5 7.5l1.75-1.75L4.5 5zM0 13V2c0-.55.45-1 1-1h10c.55 0 1 .45 1 1v11c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1zm1 0h10V2H1v11z"
20-
></path>
20+
/>
2121
</svg>
2222
<span>{name}</span>
2323
</div>

0 commit comments

Comments
 (0)