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

react4j.internal.NativeView Maven / Gradle / Ivy

The newest version!
package react4j.internal;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import jsinterop.annotations.JsConstructor;
import jsinterop.annotations.JsMethod;
import jsinterop.annotations.JsOverlay;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
import jsinterop.base.JsPropertyMap;
import react4j.ReactNode;

/**
 * The react native component.
 */
@JsType( isNative = true, namespace = JsPackage.GLOBAL, name = "React.Component" )
@SuppressWarnings( "unused" )
public abstract class NativeView
{
  @JsProperty( name = "props" )
  private JsPropertyMap inputs;
  @JsProperty
  private JsPropertyMap state;

  @JsConstructor
  protected NativeView( @Nullable final JsPropertyMap inputs )
  {
  }

  @JsMethod
  @Nullable
  public abstract ReactNode render();

  @JsOverlay
  @Nullable
  public final JsPropertyMap inputs()
  {
    return inputs;
  }

  @JsOverlay
  @Nullable
  public final JsPropertyMap state()
  {
    return state;
  }

  public final native void setState( @Nonnull JsPropertyMap state );

  public final native void forceUpdate();
}