From d8163ebe7f338aa4de429985e20a37266f25fb3a Mon Sep 17 00:00:00 2001 From: TheoryOfNekomata Date: Sat, 8 Aug 2020 23:09:08 +0800 Subject: [PATCH] Remove width dependency Adding width to calculation does not affect the `getKeyWidth` and `getKeyLeft` methods. --- src/components/Keyboard/Keyboard.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Keyboard/Keyboard.tsx b/src/components/Keyboard/Keyboard.tsx index 232a58b..b094923 100644 --- a/src/components/Keyboard/Keyboard.tsx +++ b/src/components/Keyboard/Keyboard.tsx @@ -82,8 +82,8 @@ const Keyboard: React.FC = ({ const { natural: NaturalKey = DefaultNaturalKey, accidental: AccidentalKey = DefaultAccidentalKey } = keyComponents! - const getKeyWidth = React.useCallback((k) => getKeyWidthUnmemoized(startKey, endKey)(k), [startKey, endKey, width]) - const getKeyLeft = React.useCallback((k) => getKeyLeftUnmemoized(startKey, endKey)(k), [startKey, endKey, width]) + const getKeyWidth = React.useCallback((k) => getKeyWidthUnmemoized(startKey, endKey)(k), [startKey, endKey]) + const getKeyLeft = React.useCallback((k) => getKeyLeftUnmemoized(startKey, endKey)(k), [startKey, endKey]) const isNaturalKey = React.useCallback((k) => isNaturalKeyUnmemoized(k), []) React.useEffect(() => {