We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c292d5 commit 2d76a3eCopy full SHA for 2d76a3e
packages/clay-color-picker/src/Hue.tsx
@@ -4,7 +4,7 @@
4
* SPDX-License-Identifier: BSD-3-Clause
5
*/
6
7
-import React, {useEffect, useRef} from 'react';
+import React, {useEffect, useLayoutEffect, useRef} from 'react';
8
9
import {useMousePosition} from './hooks';
10
import {hueToX, xToHue} from './util';
@@ -40,7 +40,7 @@ const ClayColorPickerHue: React.FunctionComponent<IProps> = ({
40
window.removeEventListener('mouseup', removeListeners);
41
};
42
43
- useEffect(() => {
+ useLayoutEffect(() => {
44
if (containerRef.current && selectorActive.current) {
45
onChange(xToHue(x, containerRef.current));
46
}
0 commit comments