Typing of `act` broken
See original GitHub issueDescribe the bug
The act
function exported by @testing-library/react-native
is always of type (callback: () => void) => void
. However, the underlying function coming from react-test-renderer also has overloads for promises which are incorrectly suppressed.
This error in typing leads to linter errors when one tries to pass promise-returning callbacks to act
or tries to await a promise-returning act
.
Expected behavior
The act
function should have the same typing as the underlying function from react-test-renderer.
Steps to Reproduce
The following snippet will produce linter errors such as this one, depending on one’s linter configuration.
import { act } from '@testing-library/react-native'
await act(async () => {
await Promise.resolve();
});
Versions
@testing-library/react-native: ^11.3.0 => 11.3.0
react: 18.0.0 => 18.0.0
react-native: 0.69.6 => 0.69.6
react-test-renderer: ^18.2.0 => 18.2.0
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:9 (3 by maintainers)
Top Results From Across the Web
ACT Test Accommodations and English Learner Supports
Allowable ACT Accommodations and English Learner (EL) Supports (PDF), Provides a breakdown of accommodations available and the test type in which they are ......
Read more >How to Fix a Broken Keyboard | Digital Trends
How to fix a broken keyboard · Right-click on the Start button and select Device Manager on the Power User menu. · Expand...
Read more >ACT Sections: What's on the ACT? - The Princeton Review
The ACT sections include English, Reading, Math and Science. Get a breakdown of each section including what's tested, number of questions, and time...
Read more >The ACT Test: Format, Timing & Question Types - StudyPoint
General information about the ACT and its format. Learn about the questions types and how the test is structured. Access a Free ACT...
Read more >iPhone randomly typing scrolling and opening apps - YouTube
This is a common problem that can be fixed and it covers all iPhone models. The most common issues I hear people say...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You’ll need to fork the repo and create a branch there. You’ll then be able to create a PR back to this repo from yours.
Please modify both the TS and flow types 😃
I’m struggling with time right now, got a lot going on at work, so won’t be able to do that right now 😞 (and I’m not personally impacted because we use the types of RTL’s act).