Package-level declarations

Types

Link copied to clipboard
sealed external interface EventSimulator<O : EventInit>
Link copied to clipboard
external object Simulate

Simulate an event dispatch on a DOM node with optional eventData event data. Simulate has a method for every event that React understands.

Functions

Link copied to clipboard
suspend fun <T> act(block: () -> T): T
Link copied to clipboard
external fun <T> actAsync(callback: () -> T): Promise<T>
Link copied to clipboard
suspend fun createRoot(container: HTMLElement, component: FC<Props>): Root
Link copied to clipboard
inline operator fun <O : EventInit> EventSimulator<O>.invoke(element: Element, block: O.() -> Unit)
Link copied to clipboard
external fun isElement(element: Any?): Boolean

Returns true if element is any React element.

Link copied to clipboard
external fun isElementOfType(element: ReactElement<*>, type: ComponentType<*>): Boolean

Returns true if element is a React element whose type is of a React type.

Link copied to clipboard
external fun renderIntoDocument(element: ReactElement<*>)

Render a React element into a detached DOM node in the document.

Link copied to clipboard
fun runReactTest(testBody: suspend TestScope.(container: HTMLElement) -> Unit): TestResult
fun runReactTest(component: FC<Props>, testBody: suspend TestScope.(container: HTMLElement) -> Unit): TestResult
Link copied to clipboard
suspend fun unmount(root: Root)