PropTypes


#1

Hello,

When do you capitalize propTypes to PropTypes? What's the rule there?

When I was completing this exercise, I initially used a lower case 'propTypes' and it would not run pass until it was capitalized.

TIA!

import React from 'react';

export class GuineaPigs extends React.Component {
  render() {
    let src = this.props.src;
    return (
      <div>
        <h1>Cute Guinea Pigs</h1>
        <img src={src} />
      </div>
    );
  }
}

GuineaPigs.propTypes = {
  src: React.PropTypes.string.isRequired
};

#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.