0

I'm using the following statement in my return like this:

import React from "react";

export default function App() {

  function GetFormConfigurationArray(event) {
    console.log('Blaaaah');
  }

  return (
    <div>
      { document.onreadystatechange = () => {GetFormConfigurationArray()}}
    </div>
  );
}

It works. Calls the function and runs the code successfully, but I'm also getting this warning:

Warning: Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.
    at div
    at App

What's it's really trying to tell me and what's the right way to make this call?

Diego Felipe
  • 386
  • 5
  • 19

0 Answers0