Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

React 18 double-render in Strict Mode breaks component #61

Open
betaorbust opened this issue Mar 15, 2023 · 1 comment
Open

React 18 double-render in Strict Mode breaks component #61

betaorbust opened this issue Mar 15, 2023 · 1 comment

Comments

@betaorbust
Copy link

betaorbust commented Mar 15, 2023

Description

In React 18, <StrictMode> was introduced, that effectively just re-renders everything twice to shake out memory leaks and unintended bugs.
It looks like this causes tiny-slider-react to throw or not show up on the page. By triggering on and off Strict Mode I can pretty reliably cause an error.

Reproduction

Here is a full repro case. Adjusting the TRIGGER_BUG variable to true will enable Strict Mode and cause the issues I've been seeing.

@zavsievich
Copy link

Hi! Small update: the current version of the slider is 0.5.7 and the problem is still there: now the page doesn't crash, but the slider doesn't initialize. You can see it in your CodeSandbox if you updated the version.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants