Skip to content

Commit

Permalink
Memoize the runCode callback.
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark committed Aug 18, 2024
1 parent 04f3a1e commit ba5ba79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function AppContent() {
setActiveTab('amaranth-source');
}

async function runCode() {
const runCode = React.useCallback(async () => {
if (running)
return;
try {
Expand Down Expand Up @@ -155,7 +155,7 @@ function AppContent() {
setRunning(false);
setOutputOutOfDate(false);
}
}
}, [amaranthSource, amaranthVersion]);

function tabAndPanel({ key, title, titleStyle = {}, content }) {
return [
Expand Down

0 comments on commit ba5ba79

Please sign in to comment.