mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-19 17:50:37 -07:00
refactor(ui): Optimize rendering performance (#8239)
This commit is contained in:
@@ -15,7 +15,7 @@ export const useStateAndRef = <
|
||||
>(
|
||||
initialValue: T,
|
||||
) => {
|
||||
const [_, setState] = React.useState<T>(initialValue);
|
||||
const [state, setState] = React.useState<T>(initialValue);
|
||||
const ref = React.useRef<T>(initialValue);
|
||||
|
||||
const setStateInternal = React.useCallback<typeof setState>(
|
||||
@@ -32,5 +32,5 @@ export const useStateAndRef = <
|
||||
[],
|
||||
);
|
||||
|
||||
return [ref, setStateInternal] as const;
|
||||
return [state, ref, setStateInternal] as const;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user