Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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: [],
};
like image 333
U r s u s Avatar asked Dec 12 '16 15:12

U r s u s


1 Answers

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

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

    return;
  }
  projects: [],
};
like image 179
Lyubomir Avatar answered Oct 21 '22 07:10

Lyubomir