A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/testing-library/react-testing-library/issues/509 below:

Support for React 18 · Issue #509 · testing-library/react-testing-library · GitHub

Describe the feature you'd like:

It's probably premature, given experimental nature of Concurrent mode. but I might as we start the discussion.

Perhaps I am misunderstanding something, but I think it would be useful if tests would run in Concurrent mode to mimic real app behavior as close as possible.

At this point, it's probably about replacing ReactDOM.render with ReactDOM.createRoot.

The question is how to make it in a compatible way so people can decide which version to use without polluting actual test files with it.

Suggested implementation:

Probably the most obvious choice is exposing function renderConcurrent which would be fine for the experimental phase. However, given that Concurrent will most likely become a "new normal" eventually, it would be kinda weird to have that in tests.

Perhaps the env variable might be better approach ultimately. It's easy to switch and doesn't need to pollute actual test files with it.

Describe alternatives you've considered:

Publishing major version when Concurrent mode is official and stable and keep rolling in that direction only. An obvious drawback is that people would need to stick to the previous major as long as they are testing against code that doesn't support Concurrent mode.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4