Skip to content

Commit

Permalink
Use 'useRef' on every rendering to avoid the React 'Something wrong' …
Browse files Browse the repository at this point in the history
…page
  • Loading branch information
asheshv committed Sep 16, 2024
1 parent 3f2a2ff commit 8243e2d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,12 @@ export default function MacrosDialog({onClose, onSave}) {
value: m.id,
}));

const schema = React.useRef(null);

if(keyOptions.length <= 0) {
return <></>;
}

const schema = React.useRef(null);

if (!schema.current)
schema.current = new MacrosSchema(keyOptions);

Expand Down

0 comments on commit 8243e2d

Please sign in to comment.