Topic

Props & PropTypes in React

Props allow you to pass data to components, attach events or nest components. Props constitute another fundamental unit of knowledge needed to really understand how React works and how to use it efficiently.


5 resources available

How To Master Advanced React Design Patterns: Render Props

In this tutorial, we will discuss the 'render props' design pattern. This design pattern can be a bit of a head scratcher at first and in order to truly grasp how it exactly works, we need a in-depth understanding of the top level React API and how the JSX code we write is converted to javascript. So [continue]

Tutorial by Shaun David Hutch

Answers to common questions about render props

Article by Kent C. Dodds

React Pattern: Centralized PropTypes

There are three popular ways to handle types in React: PropTypes, TypeScript and Flow. This post is about PropTypes, which are currently the most popular. In real apps with large objects, this quickly leads to a lot of code. That's a problem, because in React, you’ll often pass the same object to multiple [continue]

Article by Cory House

React Props and PropTypes Tutorial 2017

Learn how to use props in React and how to check the data types flowing through your app using React PropTypes. [continue]

Video Tutorial by Ihatetomatoes

Validating Props easily with React PropTypes

React PropTypes are a good way to help you catching bugs by validating data types of values passed through props. They also offer possibilities to flag props as mandatory or set default values. They provide a great benefit with little effort. [continue]

Article by Andreas Reiterer

How to use React PropTypes / Reasons to use PropTypes / What PropTypes are available / Static PropTypes / Why React PropTypes are important / Typechecking with PropTypes / Defining PropTypes on components / Using PropTypes with ES2015 Class-based and stateless components / Validating Props easily with React PropTypes