What I mean by "changing" props is really more like calculating stuff using the props. Props are just data that happen to come from a parent component. In the render()
function, you can calculate stuff form the props, create a new variable, and if that variable is then passed down to a child component, it's a prop when your point of view is inside the child component.
So let's imagine you work over here at PayPal. We might want to query the server for a user's credit cards and funding options. So we might have a prop called wallet
. Our propTypes validation will look something like this:
propTypes: {
wallet: React.PropTypes.shape({
visaNumber: React.PropTypes.string.isRequired,
mastercardNumber: React.PropTypes.string.isRequired,
paypalBalance: React.PropTypes.string.isRequired,