Skip to content

Commit 458583a

Browse files
authored
refactor & perf of file ThinkingBudgetSlider.tsx (RooCodeInc#2816)
1 parent f76ec25 commit 458583a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/tasty-plums-laugh.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"claude-dev": patch
3+
---
4+
5+
refactor & perf of file `ThinkingBudgetSlider.tsx`

webview-ui/src/components/settings/ThinkingBudgetSlider.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { memo, useState } from "react"
1+
import { memo, useCallback, useState } from "react"
22
import { anthropicModels, ApiConfiguration } from "@shared/api"
33
import { VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react"
44
import styled from "styled-components"
@@ -92,10 +92,10 @@ const ThinkingBudgetSlider = ({ apiConfiguration, setApiConfiguration }: Thinkin
9292
// Add local state for the slider value
9393
const [localValue, setLocalValue] = useState(apiConfiguration?.thinkingBudgetTokens || 0)
9494

95-
const handleSliderChange = (event: React.ChangeEvent<HTMLInputElement>) => {
95+
const handleSliderChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {
9696
const value = parseInt(event.target.value, 10)
9797
setLocalValue(value)
98-
}
98+
}, [])
9999

100100
const handleSliderComplete = () => {
101101
setApiConfiguration({

0 commit comments

Comments
 (0)