React Native Testing Library: queries, user events and the v14 async switch
🦉 Simple and complete React Native testing utilities that encourage good testing practices.
At a glance
- What is it?
- RNTL renders React Native components on top of Test Renderer and pushes tests toward how users actually interact with an app. Version 14 drops React 18 and makes the async APIs the default, which changes how existing suites behave.
- Who is it for?
- Adopt RNTL if you write Jest tests for React Native components and want queries keyed to roles, labels and text rather than internal state; the render, screen and userEvent surface is documented and the v14 migration guide is the first thing to read before upgrading. Do not adopt it if you need end-to-end coverage of a real device build, since RNTL simulates the runtime rather than running the app.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 9 days ago.
- What is it written in?
- Mainly TypeScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.
Editorial analysis
What RNTL is for, and who ends up using it
The README states the problem plainly: you want maintainable tests for React Native components, tests that stay green when you refactor implementation without changing behaviour. That is the whole pitch. RNTL is for teams already running Jest in a React Native project who are tired of assertions that reach into component internals and break on every rename. The primary guiding principle quoted in the README is that the more tests resemble the way software is used, the more confidence they give. In practice that means queries like getByRole, getAllByLabelText and getByText instead of reading props or instance state. It is a component-level tool. It does not boot a simulator, does not talk to a device, and does not replace an end-to-end suite. If your test needs a real native module, a splash screen or a network round trip to a staging API, this is the wrong layer. The README also points at a community resources list and a troubleshooting guide, which is a signal about where maintainers expect questions to land: not in the source, in the docs.
How rendering and queries actually work under the hood
The README says RNTL simulates the React Native runtime on top of Test Renderer, the package listed as a peer dependency. So the data flow is: your component tree is rendered into a test renderer instance, that instance becomes the screen object, and queries walk the resulting tree by predicate. The screen object exposes the queries plus lifecycle methods (rerender, unmount) and helpers (debug, toJSON, root, container). Interaction is layered on top through two separate APIs. Fire Event simulates any component event directly; User Event simulates common user interactions like press and type, and the README example notes that type simulates focusing a TextInput and typing one character at a time. That distinction matters when you are debugging a flaky test: userEvent is closer to real input, fireEvent is a direct dispatch, and they do not carry the same timing behaviour. Async utilities (findBy* queries, waitFor, waitForElementToBeRemoved) handle the cases where the tree settles after a promise resolves. Configuration goes through configure and resetToDefaults, and there is a separate isHiddenFromAccessibility helper for accessibility assertions. There is also renderHook for testing hooks without a component wrapper, which the README lists under miscellaneous APIs.
Installing RNTL and writing a first interaction test
The README gives two install commands. The library itself goes in as a dev dependency, and because Test Renderer is a peer dependency it must be installed separately, also as a dev dependency. Run both from your project root.
npm install --save-dev @testing-library/react-native
npm install --save-dev test-rendererAfter that, the README example renders a QuestionsBoard, fills two labelled inputs, presses a button by role and name, and asserts the submit payload. The Jest matchers are available automatically as soon as any import from @testing-library/react-native appears in the test, so no extra setup file is needed for the matchers. Note that render is awaited in the example, which is one of the v14 async behaviours.
import { render, screen, userEvent } from '@testing-library/react-native';
import { QuestionsBoard } from '../QuestionsBoard';
test('form submits two answers', async () => {
const questions = ['q1', 'q2'];
const onSubmit = jest.fn();
const user = userEvent.setup();
await render(<QuestionsBoard questions={questions} onSubmit={onSubmit} />);
const answerInputs = screen.getAllByLabelText('answer input');
await user.type(answerInputs[0], 'a1');
await user.type(answerInputs[1], 'a2');
await user.press(screen.getByRole('button', { name: 'Submit' }));
});The two blocks above are the whole first-run path: install the package and its peer, then render, query by label text and press by role.
The v14 migration is the real adoption cost
The README links a migration guide titled Migration to 14.0 with a one-line summary: drops React 18, async APIs by default. That is two changes bundled into one major. Dropping React 18 is a hard floor on your dependency graph, and making async APIs the default means code that previously relied on synchronous render and synchronous fireEvent results may need awaits added, or may behave differently under concurrent rendering. The README does not document a rollback path, and it does not describe what happens to a suite that mixes awaited and unawaited calls. Treat the migration guide, not the README, as the document you read before bumping the version. The repository keeps a README-v13.md alongside README.md, which suggests the maintainers intend the v13 documentation to remain reachable rather than being folded into the main file.
Where RNTL stops being the right tool
RNTL renders into Test Renderer, so anything that depends on the native side of React Native is outside its reach. Native modules, gesture handlers backed by native code, animations driven by the native driver, and platform-specific rendering differences are all invisible here. The README is explicit that it tests components and simulates the runtime; it never claims device fidelity. A second limitation is runner support. The README says the project is tested to work with Jest but should work with other test runners as well, which is a statement about intent, not a guarantee. If you use Vitest or another runner, you are on your own for matcher registration and module resolution, because the automatic Jest matcher behaviour described in the README is tied to Jest. A third is accessibility testing: isHiddenFromAccessibility tells you whether a node is hidden from accessibility services, not whether your screen passes an audit.
How it differs from Detox and from jest-native
Detox drives a real application binary on a simulator or device and asserts on what the app actually renders after native work completes. RNTL never leaves the JavaScript process. That difference decides the split: Detox catches integration failures across the native bridge at the cost of slower, more fragile runs, while RNTL catches component behaviour and refactor breakage in milliseconds. They are complements, not substitutes, and a project with a Detox suite still benefits from RNTL for the fast feedback loop. The other comparison is @testing-library/jest-native, which historically supplied custom Jest matchers for React Native. RNTL now ships built-in Jest matchers that activate on any import from the package, so the separate matcher package is no longer the mechanism you reach for when you want toBeOnTheScreen-style assertions. On the query side, RNTL mirrors React Testing Library's predicate model, which is why teams moving between web and React Native tests find the vocabulary familiar.
Licence, maintenance and what upgrading involves
The package is MIT licensed, which permits commercial use and modification provided the licence text is retained; this is a description of the licence terms, not legal advice, and you should have your own counsel review anything that matters to your organisation. The repository is not archived and the last push was on 2026-09-21, with v14.0.1 released on 2026-06-23. Upgrade cost is concentrated in the major version boundary: v14.0.0 landed on 2026-06-05 after three release candidates, and the migration guide is the document that enumerates what breaks. The repository layout includes a codemods directory and a test:codemods script, which indicates that at least some of the v14 changes are intended to be automated rather than hand-edited. Beyond that, the docs are generated from source through a docs:generate script and checked in CI with docs:check, so the API documentation in the docs folder is expected to stay in sync with the code rather than drifting.
Editorial conclusion
Adopt RNTL if you write Jest tests for React Native components and want queries keyed to roles, labels and text rather than internal state; the render, screen and userEvent surface is documented and the v14 migration guide is the first thing to read before upgrading. Do not adopt it if you need end-to-end coverage of a real device build, since RNTL simulates the runtime rather than running the app. Verify first that Test Renderer is installed as a dev dependency and that your React version is compatible with v14, which drops React 18 and makes async APIs the default.
Frequently asked questions
Is there a testing library for React Native?
Yes. React Native Testing Library tests React Native components by simulating the React Native runtime on top of Test Renderer, and the README states it is tested to work with Jest but should work with other test runners as well.
How do I install React Native Testing Library?
The README gives two commands: npm install --save-dev @testing-library/react-native, then npm install --save-dev test-renderer, because Test Renderer is listed as a peer dependency and must be installed as a dev dependency.
What is React Native Testing Library?
It is a set of testing utilities for React Native components, inspired by React Testing Library, whose guiding principle is that the more tests resemble the way software is used, the more confidence they give. It exposes render, screen, Jest matchers, userEvent, fireEvent and renderHook.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/callstack-react-native-testing-library)