Skip to content

Commit 9722b83

Browse files
committed
fix(useInteractorStyle): get latest value
1 parent 8d700e3 commit 9722b83

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/core/modules/useInteractorStyle.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@ const settingToManipulator = (setting: ManipulatorSettings) => {
9292

9393
export function useInteractorStyleManipulatorSettings(
9494
getStyle: () => vtkInteractorStyle,
95-
isExternalStyle: boolean,
95+
isExternalStyle: () => boolean,
9696
settings: ManipulatorSettings[]
9797
) {
9898
useComparableEffect(
9999
() => {
100100
// Assumes external styles are externally controlled
101-
if (isExternalStyle) return;
101+
if (isExternalStyle()) return;
102102
if (!getStyle().isA('vtkInteractorStyleManipulator')) return;
103103

104104
const style = getStyle() as vtkInteractorStyleManipulator;
@@ -143,7 +143,7 @@ export function useInteractorStyle(
143143
);
144144

145145
const externalStyleRef = useRef<vtkInteractorStyle | null>(null);
146-
const isExternalStyle = !!externalStyleRef.current;
146+
const isExternalStyle = useCallback(() => !!externalStyleRef.current, []);
147147

148148
const getStyle = useCallback(() => {
149149
return externalStyleRef.current ?? getInternalStyle();

0 commit comments

Comments
 (0)