The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Use propTypes in Reusable React Native Components

Use propTypes in Reusable React Native Components

2:50
In this React Native lesson, we will be creating a reusable Badge component. The component will also make use of `propTypes` to validate that its required data is being passed in when it is used.
Watch this lesson now
Avatar
egghead.io

In this React Native lesson, we will be creating a reusable Badge component. The component will also make use of propTypes to validate that its required data is being passed in when it is used.

Avatar
Mel

The github link is broken

Avatar
Christophe

The component could be more reusable if you only pass the url, the name and the login instead of passing the whole userInfo object. Furthermore, you can check each type of your props intead of just checking that you have an object (which not guarantte that you will have url login and name keys + are strings)
Just say'in.
Good work.

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?