Is it bad practice to define a function (like handleClick in the example below) inside a stateless component? I was told that you should avoid doing so, but I can't find anything in the documentation to confirm it. If the answer is "yes" then why is defining a function into a class instead any better?
function MiniPalette(props) {
const {classes } = props;
function handleClick() {
history.push(`palette/${id}`);
}
return (
<div className={classes.root} onClick={handleClick}>
<div className={classes.colors}>{miniColorBoxes}</div>
<h5 className={classes.title}>
{paletteName}
<span className={classes.emoji}>{emoji}</span>
</h5>
</div>
);
}