Skip to content

Commit 6bd5601

Browse files
authored
fixes(web): don't return value in uselayouteffect (callstack#241)
1 parent 150485c commit 6bd5601

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/js/RNCSliderNativeComponent.web.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,9 @@ const RCTSliderWebComponent = React.forwardRef(
184184
const containerRef = forwardedRef || React.createRef();
185185
const hasBeenResized = React.useRef(false);
186186
const [value, setValue] = React.useState(initialValue || minimumValue);
187-
React.useLayoutEffect(() => updateValue(initialValue), [
188-
initialValue,
189-
updateValue,
190-
]);
187+
React.useLayoutEffect(() => {
188+
updateValue(initialValue);
189+
}, [initialValue, updateValue]);
191190

192191
const percentageValue =
193192
(value - minimumValue) / (maximumValue - minimumValue);

0 commit comments

Comments
 (0)