I just came across a question about React performances when settings default values in one of my stateless functional components.
This component had
One big difference between defaultProps and default function parameters is that the former will be checked against propTypes. The require-default-props rule of eslint-plugin-react explains it very well.
One advantage of
defaultPropsover custom default logic in your code is thatdefaultPropsare resolved by React before thePropTypestypechecking happens, so typechecking will also apply to yourdefaultProps. The same also holds true for stateless functional components: default function parameters do not behave the same asdefaultPropsand thus usingdefaultPropsis still preferred.