public abstract class Component
extends java.lang.Object
Constructor and Description |
---|
Component() |
Modifier and Type | Method and Description |
---|---|
protected void |
bindComponent(NativeComponent nativeComponent)
Bind the native react component to this component.
|
protected abstract int |
getComponentId()
Return the unique identifier of component according to Arez.
|
protected abstract java.lang.String |
getComponentName()
Return the name of the component according to Arez.
|
protected void |
populateDebugData(jsinterop.base.JsPropertyMap<java.lang.Object> data)
Populate the state parameter with any data that is useful when debugging the component.
|
protected jsinterop.base.JsPropertyMap<java.lang.Object> |
props()
Return the component props from the native component.
|
protected abstract ReactNode |
render()
Render the component.
|
protected void |
scheduleRender()
Schedule this component for re-rendering skipping the
shouldComponentUpdate() lifecycle method. |
protected void |
scheduleRender(boolean force)
Schedule this component for re-rendering.
|
protected void |
storeDebugDataAsState()
Store debug data on the state object of the native component.
|
protected final void bindComponent(@Nonnull NativeComponent nativeComponent)
nativeComponent
- the native react component.protected final jsinterop.base.JsPropertyMap<java.lang.Object> props()
protected final void scheduleRender()
shouldComponentUpdate()
lifecycle method.
This is equivalent to calling scheduleRender(boolean)
passing a true
value.scheduleRender(boolean)
protected final void scheduleRender(boolean force)
shouldComponentUpdate()
lifecycle method will be skipped if the force parameter is true as calling this method is equivalent to
calling forceUpdate() on the native react component. See the React Component
documentation for more details.force
- if true then the component will skip the shouldComponentUpdate()
lifecycle method.@Nullable protected abstract ReactNode render()
@OmitSymbol(unless="react4j.store_debug_data_as_state") protected final void storeDebugDataAsState()
React.shouldStoreDebugDataAsState()
returns true and is primarily
done to make it easy to debug the component from within React DevTools.@ComponentIdRef protected abstract int getComponentId()
@ComponentNameRef protected abstract java.lang.String getComponentName()
@OmitSymbol(unless="react4j.store_debug_data_as_state") protected void populateDebugData(@Nonnull jsinterop.base.JsPropertyMap<java.lang.Object> data)
data
- the property map to populate with debug data.