Core Props Examples       Comp Projects

Props and Prop Types

Props

All Components have Props (properties). These properties are like opacity, rotation,width,height,x,y etc etc.

The props that each Components have are of 2 type. First type of props are called "Core Props" which each Component inherets from "BaseComponent" class. Second type of props are called "Component Props" which are individual to each component depending upon the purpose of that Component

Every Prop (core prop or Component props) is a wrapper around a value (string,number,boolean). For example the "rotation" prop is a wrapper around a Number which represents the rotate angle of the component.

Each of these Props provide methods (like animate, goto, jumpBetween) using which we can animate them.

So to animate a Component we attach animations to its props.

Prop Types


Any prop (core or component prop) will be one of the following Types

AniNumber (Animated Number)

This is a wrapper around a number. Props like rotation,opacity,fontSize etc are of type AniNumber

AniBoolean (Animated Boolean)

This is a wrapper around a boolean. Props like "visible", "showBackground" etc are of type AniBoolean

AniString (Animated String)

This is a wrapper around a string. Props like "content" etc are of type AniString

AniColor (Animated Color)

This is a wrapper around a color. Work in progress!!!!!

AniPerc (Animated Number)

This is a wrapper around a Percentage. Props like width and height are of type AniPerc


The Core props are present in every component BUT depending upon the purpose of the Component it may not implement some of the Core props or it may implement them differently.