I'am new in react native , and i'am using tcomb-form library to create forms for my app. I want to add a default values to some of my fields, means when they first appear they must have values by default. This is what i tried so far but the field still appears empty :
this.Position = t.struct({
PosName: FormFields.String,
});
fields:{
PosName: {
placeholder: "Name der Position",
error: "Dieses Feld ist erforderlich",
label: "Name der Position",
value: "some text here ",
template: Template
},
//... other fields here
}
You can create an object with your fields and your default values and then pass it to your form element like this:
And then on your render:
Here's the docs: tcomb-form-native default values