How it works...

Even with functional components, we can validate our PropTypes. Remember, if you don't need any dynamic data or local state then you should consider using a stateless component. This will improve the performance of your application.

Get React Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.