001package react4j.internal; 002 003import javax.annotation.Nonnull; 004import javax.annotation.Nullable; 005import jsinterop.annotations.JsConstructor; 006import jsinterop.annotations.JsMethod; 007import jsinterop.annotations.JsOverlay; 008import jsinterop.annotations.JsPackage; 009import jsinterop.annotations.JsProperty; 010import jsinterop.annotations.JsType; 011import jsinterop.base.JsPropertyMap; 012import react4j.ReactNode; 013 014/** 015 * The react native component. 016 */ 017@JsType( isNative = true, namespace = JsPackage.GLOBAL, name = "React.Component" ) 018@SuppressWarnings( "unused" ) 019public abstract class NativeView 020{ 021 @JsProperty( name = "props" ) 022 private JsPropertyMap<Object> inputs; 023 @JsProperty 024 private JsPropertyMap<Object> state; 025 026 @JsConstructor 027 protected NativeView( @Nullable final JsPropertyMap<Object> inputs ) 028 { 029 } 030 031 @JsMethod 032 @Nullable 033 public abstract ReactNode render(); 034 035 @JsOverlay 036 @Nullable 037 public final JsPropertyMap<Object> inputs() 038 { 039 return inputs; 040 } 041 042 @JsOverlay 043 @Nullable 044 public final JsPropertyMap<Object> state() 045 { 046 return state; 047 } 048 049 public final native void setState( @Nonnull JsPropertyMap<Object> state ); 050 051 public final native void forceUpdate(); 052}