I
- the type of the native component.public abstract class NativeAdapterComponent<I extends Component> extends NativeComponent
Component
. This class is also responsible for calling
Component.setLifecycleMethod(LifecycleMethod)
before and after each call to the target component
if ReactConfig.checkComponentStateInvariants()
returns true. This will make it possible for the
target component to check that the application code is correctly interacting with the React component
framework. In production builds it is expected that the method calls will be inlined and the checks will
be optimized away, having no significant performance impact.Modifier | Constructor and Description |
---|---|
protected |
NativeAdapterComponent(jsinterop.base.JsPropertyMap<java.lang.Object> props)
Create a component that designed to delegate to a target component.
|
Modifier and Type | Method and Description |
---|---|
protected abstract I |
createComponent()
Template method that actually creates the target component.
|
protected void |
performComponentDidCatch(elemental2.core.JsError error,
ReactErrorInfo info)
Call componentDidCatch on the target component.
|
protected void |
performComponentDidMount()
Call componentDidMount on the target component.
|
protected void |
performComponentDidUpdate(jsinterop.base.JsPropertyMap<java.lang.Object> nextProps,
jsinterop.base.JsPropertyMap<java.lang.Object> nextState)
Call componentDidUpdate on the target component.
|
protected void |
performComponentWillUnmount()
Call componentWillUnmount on the target component.
|
protected boolean |
performShouldComponentUpdate(jsinterop.base.JsPropertyMap<java.lang.Object> nextProps,
jsinterop.base.JsPropertyMap<java.lang.Object> nextState)
Call shouldComponentUpdate on the target component.
|
ReactNode |
render()
Call render on the target component.
|
@JsConstructor protected NativeAdapterComponent(@Nullable jsinterop.base.JsPropertyMap<java.lang.Object> props)
props
- the initial props.protected abstract I createComponent()
@Nullable public final ReactNode render()
render
in class NativeComponent
Component.render()
protected final void performComponentDidMount()
Component.componentDidMount()
protected final void performComponentWillUnmount()
Component.componentWillUnmount()
protected final boolean performShouldComponentUpdate(@Nonnull jsinterop.base.JsPropertyMap<java.lang.Object> nextProps, @Nonnull jsinterop.base.JsPropertyMap<java.lang.Object> nextState)
nextProps
- the new properties of the component.nextState
- the new state of the component.Component.shouldComponentUpdate(JsPropertyMap, JsPropertyMap)
protected final void performComponentDidUpdate(@Nonnull jsinterop.base.JsPropertyMap<java.lang.Object> nextProps, @Nonnull jsinterop.base.JsPropertyMap<java.lang.Object> nextState)
nextProps
- the new properties of the component.nextState
- the new state of the component.Component.componentDidUpdate(JsPropertyMap, JsPropertyMap)
protected final void performComponentDidCatch(@Nonnull elemental2.core.JsError error, @Nonnull ReactErrorInfo info)
error
- the error that has been thrown.info
- information about component stack during thrown error.Component.componentDidCatch(JsError, ReactErrorInfo)