Skip to content

Commit 640a8b0

Browse files
committed
update eslint react plugin
1 parent a695d0b commit 640a8b0

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"esbuild": "^0.25.8",
6464
"eslint": "^9.32.0",
6565
"eslint-plugin-html": "^8.1.1",
66-
"eslint-plugin-react-hooks": "^5.2.0",
66+
"eslint-plugin-react-hooks": "^7.0.0",
6767
"eslint-plugin-react-refresh": "^0.4.19",
6868
"express": "^5.1.0",
6969
"globals": "^16.0.0",

packages/sandcastle/src/App.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,12 @@ function RightSideAllotment({
106106
]);
107107
}
108108
setConsoleExpanded(!consoleExpanded);
109-
}, [consoleExpanded, previousConsoleHeight]);
109+
}, [
110+
consoleExpanded,
111+
previousConsoleHeight,
112+
consoleCollapsedHeight,
113+
setConsoleExpanded,
114+
]);
110115

111116
useImperativeHandle(ref, () => {
112117
return {

packages/sandcastle/src/Gallery/GalleryItemSearchInput.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useCallback, useMemo, useRef } from "react";
1+
import { useCallback, useMemo, useRef, useState } from "react";
22
import { IconButton, TextBox } from "@stratakit/bricks";
33
import { close, search as searchIcon } from "../icons.ts";
44

@@ -7,14 +7,14 @@ import { useGalleryItemContext } from "./GalleryItemStore.ts";
77
export function GalleryItemSearchInput() {
88
const store = useGalleryItemContext();
99
const inputRef = useRef<HTMLInputElement>(null);
10-
const value = inputRef.current?.value;
1110
const { setSearchTerm, items } = store ?? {};
12-
const hasValue = !!value && value !== "";
11+
const [hasValue, setHasValue] = useState(false);
1312

1413
const clearSearch = useCallback(() => {
1514
const input = inputRef.current;
1615
if (input) {
1716
input.value = "";
17+
setHasValue(false);
1818
input.focus();
1919
}
2020

@@ -26,6 +26,7 @@ export function GalleryItemSearchInput() {
2626
const updateSearch = useCallback(
2727
(e: { target: { value: string | null } }) => {
2828
let term = e.target.value;
29+
setHasValue(!!term && term !== "");
2930
if (setSearchTerm) {
3031
if (term) {
3132
term = term.trim();

packages/sandcastle/src/SandcastleEditor.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ function SandcastleEditor({
117117
});
118118
}, [fontSize]);
119119

120+
function formatEditor() {
121+
internalEditorRef.current?.getAction("editor.action.formatDocument")?.run();
122+
}
123+
120124
useImperativeHandle(ref, () => {
121125
return {
122126
formatCode() {
@@ -125,10 +129,6 @@ function SandcastleEditor({
125129
};
126130
}, []);
127131

128-
function formatEditor() {
129-
internalEditorRef.current?.getAction("editor.action.formatDocument")?.run();
130-
}
131-
132132
function handleEditorDidMount(
133133
editor: monaco.editor.IStandaloneCodeEditor,
134134
monaco: Monaco,

0 commit comments

Comments
 (0)