All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.react.ReactNode.kt Maven / Gradle / Ivy

@file:Suppress("NOTHING_TO_INLINE")

package react

import kotlinx.js.ReadonlyArray

sealed external interface ReactNode

inline fun ReactNode(
    source: ReadonlyArray,
): ReactNode =
    source.unsafeCast()

inline fun ReactNode(
    source: String,
): ReactNode =
    source.unsafeCast()

fun ReactNode.asStringOrNull(): String? =
    asDynamic() as? String

fun ReactNode.asElementOrNull(): ReactElement<*>? =
    if (isValidElement(this)) {
        unsafeCast>()
    } else null




© 2015 - 2025 Weber Informatics LLC | Privacy Policy