@types/react-test-renderer
- Version 18.0.2
- Published
- 8.77 kB
- 1 dependency
- MIT license
Install
npm i @types/react-test-renderer
yarn add @types/react-test-renderer
pnpm add @types/react-test-renderer
Overview
TypeScript definitions for react-test-renderer
Index
Variables
Functions
Interfaces
Type Aliases
Variables
variable UNDEFINED_VOID_ONLY
const UNDEFINED_VOID_ONLY: Symbol;
Functions
function act
act: { (callback: () => Promise<VoidOrUndefinedOnly>): Promise<undefined>; (callback: () => VoidOrUndefinedOnly): DebugPromiseLike;};
Wrap any code rendering and triggering updates to your components into
act()
calls.Ensures that the behavior in your tests matches what happens in the browser more closely by executing pending
useEffect
s before returning. This also reduces the amount of re-renders done.Parameter callback
An asynchronous, void callback that will execute as a single, complete React commit.
See Also
https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks
Wrap any code rendering and triggering updates to your components into
act()
calls.Ensures that the behavior in your tests matches what happens in the browser more closely by executing pending
useEffect
s before returning. This also reduces the amount of re-renders done.Parameter callback
A synchronous, void callback that will execute as a single, complete React commit.
See Also
https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks
function create
create: ( nextElement: ReactElement, options?: TestRendererOptions) => ReactTestRenderer;
Interfaces
interface DebugPromiseLike
interface DebugPromiseLike {}
method then
then: ( onfulfilled: (value: never) => never, onrejected: (reason: never) => never) => never;
interface ReactTestInstance
interface ReactTestInstance {}
property children
children: Array<ReactTestInstance | string>;
property instance
instance: any;
property parent
parent: null | ReactTestInstance;
property props
props: { [propName: string]: any };
property type
type: ElementType;
method find
find: (predicate: (node: ReactTestInstance) => boolean) => ReactTestInstance;
method findAll
findAll: ( predicate: (node: ReactTestInstance) => boolean, options?: { deep: boolean }) => ReactTestInstance[];
method findAllByProps
findAllByProps: ( props: { [propName: string]: any }, options?: { deep: boolean }) => ReactTestInstance[];
method findAllByType
findAllByType: ( type: ElementType, options?: { deep: boolean }) => ReactTestInstance[];
method findByProps
findByProps: (props: { [propName: string]: any }) => ReactTestInstance;
method findByType
findByType: (type: ElementType) => ReactTestInstance;
interface ReactTestRenderer
interface ReactTestRenderer {}
property root
root: ReactTestInstance;
method getInstance
getInstance: () => null | ReactTestInstance;
method toJSON
toJSON: () => null | ReactTestRendererJSON | ReactTestRendererJSON[];
method toTree
toTree: () => null | ReactTestRendererTree;
method unmount
unmount: (nextElement?: ReactElement) => void;
method update
update: (nextElement: ReactElement) => void;
interface ReactTestRendererJSON
interface ReactTestRendererJSON {}
interface ReactTestRendererTree
interface ReactTestRendererTree extends ReactTestRendererJSON {}
interface TestRendererOptions
interface TestRendererOptions {}
method createNodeMock
createNodeMock: (element: ReactElement) => any;
Type Aliases
type ReactTestRendererNode
type ReactTestRendererNode = ReactTestRendererJSON | string;
Package Files (1)
Dependencies (1)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/react-test-renderer
.
- Markdown[](https://www.jsdocs.io/package/@types/react-test-renderer)
- HTML<a href="https://www.jsdocs.io/package/@types/react-test-renderer"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 1580 ms. - Missing or incorrect documentation? Open an issue for this package.