I have a component in React like this:
const myAge = () => {
  var diff = Date.now() - new Date(1991, 2, 1);
  var age = new Date(diff);
  return age;
};
export const About = (props) => {
  return (
      <Container id={props.id}>
         <p> My age is: {myAge}</p>
      </Container>
  )
}
I want the result of the function myAge to be returned and rendered in the p tag, but nothing is rendered. I don't know what I'm doing wrong, any suggestions? Ty.
{myAge()}Error: Objects are not valid as a React child (found: Mon Jul 24 1995 16:02:22 GMT-0300 (hora estándar de Arg)). If you meant to render a collection of children, use an array instead.return String(age)or another way if you want to format it some specific way