U r s u s
U r s u s

Reputation: 6978

What is the default value of React.PropTypes.func

What's the correct value to replace the question marks with and why?

RecentProjectsSection.propTypes = {
  onClose: React.PropTypes.func.isRequired,
  projects: React.PropTypes.array.isRequired,
};

RecentProjectsSection.defaultProps = {
  onClose: ?????
  projects: [],
};

Upvotes: 13

Views: 13954

Answers (1)

Lyubomir
Lyubomir

Reputation: 20037

You need a function, what it does - up to you.

RecentProjectsSection.defaultProps = {
  onClose: () => { 
    // your logic here...

    return;
  }
  projects: [],
};

Upvotes: 19

Related Questions