MountSpec
Deprecated
A class that is annotated with this annotation will be used to create a component that renders something, in the form of either a Drawable or a View.
A class that is annotated with MountSpec must implement a method with the annotation. It may also implement methods with the following annotations:
If you wish to create a component that is a composition of other components, then use instead.
For example:
@MountSpec
public class MyComponentSpec {
@OnCreateMountContent
MyDrawable onCreateMountContent(Context context) {
return new MyDrawable(context);
}
@OnMount
void onMount(
ComponentContext c,
MyDrawable myDrawable,
@Prop MyProp prop) {
myDrawable.setMyProp(prop);
}
}
Content copied to clipboard
Deprecated
Use com.facebook.litho.PrimitiveComponents for new bridged components instead of MountSpec
s. Specs should only be used in Java.
For detailed information read PrimitiveComponents docs.
For migration guide from MountSpecs to PrimitiveComponents read this: Migrating MountSpecs doc.