March 2018
Beginner to intermediate
344 pages
7h 7m
English
While we should seek to communicate between child components via props, it's important to be verbose when validating properties by considering types, requirements, defaults, and so on. Throughout the book, I've used a mix of both techniques for brevity, but in production, props should be appropriately validated. Let's start out by looking at some examples of property types:
export default { props: { firstName: { type: String }, lastName: { type: String }, age: { type: Number }, friendList: { type: Array } },}
We also have various other types available such as Boolean, function, or any other constructor function (that is, type of Person). By accurately defining the types we expect, this allows us (and our team) to reason better ...
Read now
Unlock full access