Package-level declarations

Types

Link copied to clipboard
sealed external interface Action<in T> : ActionOrString<T>
Link copied to clipboard
sealed external interface ActionOrString<in T>
Link copied to clipboard
Link copied to clipboard
typealias ActionStateInstance2<S, P> = JsTuple3<S, (payload: P) -> Unit, Boolean>
Link copied to clipboard
external object Children
Link copied to clipboard
sealed external interface ChildrenBuilder
Link copied to clipboard
typealias Cleanup = () -> Unit
Link copied to clipboard
sealed external interface CleanupBuilder
Link copied to clipboard
abstract external class Component<P : Props, S : State>(props: P = definedExternally)
Link copied to clipboard
Link copied to clipboard
external interface ComponentModule<in P : Props>
Link copied to clipboard
sealed external interface ComponentType<in P : Props> : ElementType<P>
Link copied to clipboard
sealed external interface Consumer<T> : ExoticComponent<ConsumerProps<T>>
Link copied to clipboard
external interface ConsumerProps<T> : Props
Link copied to clipboard
sealed external interface Context<T> : ContextType<T>
Link copied to clipboard
sealed external interface ContextType<T> : Provider<T> , HasDisplayName
Link copied to clipboard
Link copied to clipboard
typealias Dispatch<A> = (action: A) -> Unit
Link copied to clipboard
sealed external interface ElementType<in P : Props>
Link copied to clipboard
external interface ErrorInfo
Link copied to clipboard
external interface ExoticComponent<in P : Props> : ComponentType<P>
Link copied to clipboard
external interface FC<in P : Props> : ComponentType<P> , HasDisplayName
Link copied to clipboard
sealed external interface FunctionStateInstance<T>
Link copied to clipboard
external interface HasDisplayName
Link copied to clipboard
sealed external interface IntrinsicType<in P : PropsWithClassName> : ElementType<P> , Selector
Link copied to clipboard
typealias Key = String
Link copied to clipboard
sealed external interface MutableRefObject<T : Any> : RefObject<T>
Link copied to clipboard
typealias ProfilerOnRenderCallback = (id: String, phase: String, actualDuration: Number, baseDuration: Number, startTime: Number, commitTime: Number) -> Unit

The callback passed to {@link ProfilerProps.onRender}.

Link copied to clipboard
external interface ProfilerProps : PropsWithChildren
Link copied to clipboard
external interface Props
Link copied to clipboard
Link copied to clipboard
external interface PropsWithClassName : Props
Link copied to clipboard
external interface PropsWithRef<T : Any> : Props
Link copied to clipboard
external interface PropsWithStyle : Props
Link copied to clipboard
external interface PropsWithValue<V> : Props
Link copied to clipboard
sealed external interface Provider<T> : ExoticComponent<ProviderProps<T>>
Link copied to clipboard
Link copied to clipboard
abstract external class PureComponent<P : Props, S : State>(props: P = definedExternally) : Component<P, S>
Link copied to clipboard
external interface RComponentClassStatics<P : Props, S : State, C : Context<*>?>
Link copied to clipboard
typealias ReactDsl = JsoDsl
Link copied to clipboard
sealed external interface ReactElement<P : Props> : ReactNode
Link copied to clipboard
sealed external interface ReactNode
Link copied to clipboard
sealed external interface ReactPortal : ReactElement<Props>
Link copied to clipboard
typealias Reducer<S, A> = (state: S, action: A) -> S
Link copied to clipboard

Only works inside fc

Link copied to clipboard
sealed external interface Ref<in T : Any>
Link copied to clipboard
external class RefCallback<T : Any> : Ref<T>
Link copied to clipboard
sealed external interface RefObject<T : Any> : Ref<T>
Link copied to clipboard
sealed external interface RefValueInstance<T>
Link copied to clipboard
sealed external interface RequiredContext<T : Any> : ContextType<T>
Link copied to clipboard
open class RStatics<P : Props, S : State, C : Component<P, S>, CTX : Context<*>?>(klazz: KClass<C>) : RComponentClassStatics<P, S, CTX>

Usage:

Link copied to clipboard
external interface State
Link copied to clipboard
sealed external interface StateInstance<T>

Only works inside fc

Link copied to clipboard
sealed external interface StateSetter<T>
Link copied to clipboard
external interface SuspenseProps : PropsWithChildren
Link copied to clipboard
typealias TransitionFunction = () -> Unit
Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
inline fun Action(value: String): ActionOrString<*>
fun <T> Action(value: suspend (T) -> Unit): Action<T>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
external fun <P : Props> cloneElement(element: ReactElement<P>, props: P? = definedExternally, vararg children: ReactNode?): ReactElement<P>
Link copied to clipboard
external fun <T : Any> createContext(): Context<T?>
external fun <T> createContext(defaultValue: T): Context<T>
Link copied to clipboard
external fun <P : Props> createElement(type: ElementType<P>, props: P? = definedExternally, vararg children: ReactNode?): ReactElement<P>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
external fun isValidElement(element: Any?): Boolean
Link copied to clipboard
external fun <P : Props> lazy(factory: () -> Promise<ComponentModule<P>>): ExoticComponent<P>
Link copied to clipboard
external fun <P : Props> memo(type: ComponentType<P>, propsAreEqual: (P, P) -> Boolean = definedExternally): FC<P>
Link copied to clipboard
inline fun ReactNode(source: Char): ReactNode
inline fun ReactNode(source: String): ReactNode
inline fun ReactNode(source: String?): ReactNode?
Link copied to clipboard
fun <T : Any> RefCallback(block: suspend CoroutineScope.(T) -> Unit): RefCallback<T>
Link copied to clipboard
external fun startTransition(scope: TransitionFunction)
Link copied to clipboard
inline fun <T> StateInstance(value: T, setter: StateSetter<T>): StateInstance<T>
Link copied to clipboard
external fun <T> use(context: PromiseLike<T>): T
external fun <T> use(context: Context<T>): T
external fun <T : Any> use(context: RequiredContext<T>): T?
Link copied to clipboard
fun <S> useActionState(initialState: S, permalink: String? = undefined, action: suspend CoroutineScope.(state: S) -> S): ActionStateInstance1<S>
fun <S, P> useActionState(initialState: S, permalink: String? = undefined, action: suspend CoroutineScope.(state: S, payload: P) -> S): ActionStateInstance2<S, P>
Link copied to clipboard
inline fun <T : Function<*>> useCallback(vararg dependencies: Any?, callback: T): T

Only works inside fc

Link copied to clipboard
external fun <T : Any> useDebugValue(value: T, format: (value: T) -> Any = definedExternally)

Available since 16.8

Link copied to clipboard
external fun <T> useDeferredValue(value: T): T

Available since 18.0

Link copied to clipboard
fun useEffect(effect: suspend CoroutineScope.() -> Unit)
fun useEffect(vararg dependencies: Any?, effect: suspend CoroutineScope.() -> Unit)

Only works inside fc

Link copied to clipboard
fun useEffectOnce(effect: suspend CoroutineScope.() -> Unit)

Only works inside fc

Link copied to clipboard

Only works inside fc

Link copied to clipboard
fun useEffectWithCleanup(vararg dependencies: Any?, effect: CleanupBuilder.() -> Unit)

Only works inside fc

Link copied to clipboard
Link copied to clipboard
fun <T> useEqualState(initialValue: T): StateInstance<T>
fun <T> useEqualState(initializer: () -> T): StateInstance<T>
Link copied to clipboard
external fun <T> useFunctionState(initialValue: T): FunctionStateInstance<T>
external fun <T> useFunctionState(initializer: () -> T): FunctionStateInstance<T>
Link copied to clipboard
external fun useId(): String

Available since 18.0

Link copied to clipboard
inline fun <T : Any> useImperativeHandle(ref: Ref<T>?, vararg dependencies: Any?, noinline init: () -> T?)

Available since 16.8

Link copied to clipboard
fun useInsertionEffect(effect: suspend CoroutineScope.() -> Unit)
fun useInsertionEffect(vararg dependencies: Any?, effect: suspend CoroutineScope.() -> Unit)

Only works inside fc

Link copied to clipboard
fun useInsertionEffectWithCleanup(vararg dependencies: Any?, effect: CleanupBuilder.() -> Unit)

Only works inside fc

Link copied to clipboard
fun useLayoutEffect(effect: suspend CoroutineScope.() -> Unit)
fun useLayoutEffect(vararg dependencies: Any?, effect: suspend CoroutineScope.() -> Unit)

Only works inside fc

Link copied to clipboard
fun useLayoutEffectOnce(effect: suspend CoroutineScope.() -> Unit)

Only works inside fc

Link copied to clipboard

Only works inside fc

Link copied to clipboard
fun useLayoutEffectWithCleanup(vararg dependencies: Any?, effect: CleanupBuilder.() -> Unit)

Only works inside fc

Link copied to clipboard
inline fun <T> useMemo(vararg dependencies: Any?, noinline callback: () -> T): T

Only works inside fc

Link copied to clipboard
external fun <T> useOptimistic(passthrough: T): StateInstance<T>
external fun <T, A> useOptimistic(passthrough: T, reducer: (state: T, action: A) -> T): JsTuple2<T, (action: A) -> Unit>
Link copied to clipboard
external fun <S : Any, A> useReducer(reducer: Reducer<S?, A>): ReducerInstance<S?, A>
external fun <S, A> useReducer(reducer: Reducer<S, A>, initialState: S): ReducerInstance<S, A>
external fun <S, A, I> useReducer(reducer: Reducer<S, A>, initializerArg: I, initializer: (I) -> S): ReducerInstance<S, A>

Only works inside fc

Link copied to clipboard
external fun <T : Any> useRef(initialValue: T? = definedExternally): MutableRefObject<T>
Link copied to clipboard
fun <T : Any> useRefCallback(vararg dependencies: Any?, block: suspend CoroutineScope.(T) -> Unit): RefCallback<T>
Link copied to clipboard
external fun <T : Any> useRefState(): JsTuple2<T?, RefCallback<T>>
Link copied to clipboard
inline fun <T : Any> useRefValue(): RefValueInstance<T?>
inline fun <T : Any> useRefValue(initialValue: T): RefValueInstance<T>

Only works inside fc

Link copied to clipboard
fun <T : Any> useRequired(context: Context<T?>): T
fun <T : Any> useRequired(context: RequiredContext<T>): T
Link copied to clipboard
external fun <T : Any> useState(): StateInstance<T?>
external fun <T> useState(initialValue: T): StateInstance<T>
external fun <T> useState(initializer: () -> T): StateInstance<T>

Only works inside fc

Link copied to clipboard
external fun <Snapshot> useSyncExternalStore(subscribe: (onStoreChange: () -> Unit) -> Cleanup, getSnapshot: () -> Snapshot, getServerSnapshot: () -> Snapshot = definedExternally): Snapshot

Available since 18.0

Link copied to clipboard

Available since 18.0