November 2018
Beginner
502 pages
10h 22m
English
Interface props can be optional, as we discovered in Chapter 1, TypeScript Basics. So, we can also use this mechanism to add optional props to a React component.
Let's add some optional props to allow the button captions to be configurable on our confirmation component:
interface IProps { title: string; content: string; cancelCaption?: string; okCaption?: string;}
Read now
Unlock full access