Skip to content

Commit

Permalink
FIX Don't use state unnecessarily
Browse files Browse the repository at this point in the history
This useState was breaking a test in versioned-admin - and it wasn't
necessary so I'm removing it.
  • Loading branch information
GuySartorelli committed Aug 28, 2023
1 parent 23f3ad9 commit 886a626
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions client/src/components/Loading/Loading.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { v4 as uuid } from 'uuid';

Expand All @@ -17,8 +17,9 @@ import { v4 as uuid } from 'uuid';
* that the paths are being "drawn".
*/
function Loading({ containerClass }) {
// If we are displaying many loading indicators at the same time, we need to
const [id] = useState(uuid());
// If we are displaying many loading indicators at the same time, we need to have a unique ID.
// The ID does not need to be the same each time this component renders.
const id = uuid();

return (
<div className={containerClass}>
Expand Down

0 comments on commit 886a626

Please sign in to comment.