@JsType(isNative=true,
namespace="<global>")
public final class React
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static ComponentConstructorFunction |
ConcurrentMode
The Symbol type for ConcurrentMode.
|
static ComponentConstructorFunction |
Consumer
The Symbol type for Consumer.
|
static ComponentConstructorFunction |
Element
The Symbol type for Element.
|
static ComponentConstructorFunction |
ForwardRef
The Symbol type for ForwardRef.
|
static ComponentConstructorFunction |
Fragment
The Symbol type for Fragments.
|
static ComponentConstructorFunction |
Lazy
The Symbol type for Lazy.
|
static ComponentConstructorFunction |
Memo
The Symbol type for Memo.
|
static ComponentConstructorFunction |
Portal
The Symbol type for Portal.
|
static ComponentConstructorFunction |
Profiler
The Symbol type for Profiler.
|
static ComponentConstructorFunction |
Provider
The Symbol type for Provider.
|
static ComponentConstructorFunction |
StrictMode
The Symbol type for StrictMode.
|
static ComponentConstructorFunction |
Suspense
The Symbol type for Suspense.
|
Modifier and Type | Method and Description |
---|---|
static ReactNode |
cloneElement(ReactNode element,
jsinterop.base.JsPropertyMap<java.lang.Object> props)
Clone and return a new ReactElement using element as the starting point.
|
static <T> Context<T> |
createContext(T defaultValue)
Creates a context with specified default value.
|
static ReactElement |
createElement(java.lang.String type,
jsinterop.base.JsPropertyMap<java.lang.Object> props)
Create and return a new ReactElement of the given type with no children.
|
static ReactElement |
createElement(java.lang.String type,
jsinterop.base.JsPropertyMap<java.lang.Object> props,
elemental2.core.JsArray<ReactNode> children)
Create and return a new ReactElement of the given type with specified children.
|
static ReactElement |
createElement(java.lang.String type,
jsinterop.base.JsPropertyMap<java.lang.Object> props,
ReactNode... children)
Create and return a new ReactElement of the given type with specified children.
|
static ReactElement |
createElement(java.lang.String type,
java.lang.Object props)
Create and return a new ReactElement of the given type with specified children.
|
static ReactElement |
createElement(java.lang.String type,
java.lang.Object props,
ReactNode... children)
Create and return a new ReactElement of the given type with specified children.
|
static ReactNode |
createFragment(java.util.List<? extends ReactNode> children)
Create a Fragment with the specified children.
|
static ReactNode |
createFragment(ReactNode... children)
Create a Fragment with the specified children.
|
static ReactNode |
createFragment(java.util.stream.Stream<? extends ReactNode> children)
Create a Fragment with the specified children.
|
static ReactNode |
createStrictMode(ReactNode... children)
Create a StrictMode component with the specified children.
|
static boolean |
isValidElement(ReactNode node)
Return true if the specified node is a ReactElement.
|
@JsProperty(name="Fragment") public static ComponentConstructorFunction Fragment
@JsProperty(name="StrictMode") public static ComponentConstructorFunction StrictMode
@JsProperty(name="unstable_ConcurrentMode") public static ComponentConstructorFunction ConcurrentMode
@JsProperty(name="Suspense") public static ComponentConstructorFunction Suspense
@JsProperty(name="unstable_Profiler") public static ComponentConstructorFunction Profiler
@JsProperty(name="Portal") public static ComponentConstructorFunction Portal
@JsProperty(name="Element") public static ComponentConstructorFunction Element
@JsProperty(name="Provider") public static ComponentConstructorFunction Provider
@JsProperty(name="Consumer") public static ComponentConstructorFunction Consumer
@JsProperty(name="ForwardRef") public static ComponentConstructorFunction ForwardRef
@JsProperty(name="Memo") public static ComponentConstructorFunction Memo
@JsProperty(name="Lazy") public static ComponentConstructorFunction Lazy
public static boolean isValidElement(@Nonnull ReactNode node)
node
- the node to test.@JsOverlay @Nonnull public static ReactElement createElement(@Nonnull java.lang.String type, @Nullable java.lang.Object props)
type
- A HTML tag name (eg. 'div', 'span', etc)props
- The props to pass to the element.@JsOverlay @Nonnull public static ReactElement createElement(@Nonnull java.lang.String type, @Nullable jsinterop.base.JsPropertyMap<java.lang.Object> props)
type
- A HTML tag name (eg. 'div', 'span', etc)props
- The props to pass to the element.@JsOverlay @Nonnull public static ReactElement createElement(@Nonnull java.lang.String type, @Nullable java.lang.Object props, @Nullable ReactNode... children)
type
- A HTML tag name (eg. 'div', 'span', etc)props
- The props to pass to the element.children
- The child elements.@JsOverlay @Nonnull public static ReactElement createElement(@Nonnull java.lang.String type, @Nullable jsinterop.base.JsPropertyMap<java.lang.Object> props, @Nullable ReactNode... children)
type
- A HTML tag name (eg. 'div', 'span', etc)props
- The props to pass to the element.children
- The child elements.@JsOverlay @Nonnull public static ReactElement createElement(@Nonnull java.lang.String type, @Nullable jsinterop.base.JsPropertyMap<java.lang.Object> props, @Nullable elemental2.core.JsArray<ReactNode> children)
type
- A HTML tag name (eg. 'div', 'span', etc)props
- The props to pass to the element.children
- The child elements.@JsOverlay public static ReactNode createStrictMode(@Nonnull ReactNode... children)
children
- the child nodes.@JsOverlay public static ReactNode createFragment(@Nonnull ReactNode... children)
children
- the child nodes.@JsOverlay public static ReactNode createFragment(@Nonnull java.util.List<? extends ReactNode> children)
children
- the child nodes.@JsOverlay public static ReactNode createFragment(@Nonnull java.util.stream.Stream<? extends ReactNode> children)
children
- the child nodes.@Nonnull public static <T> Context<T> createContext(T defaultValue)
T
- the type of the context.defaultValue
- the default value.@JsOverlay public static ReactNode cloneElement(@Nonnull ReactNode element, @Nullable jsinterop.base.JsPropertyMap<java.lang.Object> props)
element
- the element to cloneprops
- the props to merge