I am running the current version of reactJS with hooks. I have three code modules in my app: header.js which creates a navbar and exports it to app.js which adds some other objects and exports all of this to index.js.

I am trying to add an event listener to the individual tiles in the navbar so that I can redirect to the appropriate page.

```
code
    var listenerElement = document.getElementById("Tile1");

   if (listenerElement !== null) {
     listenerElement.addEventListener("click", navbarClicked) ;
     console.log(listenerElement);
   } else {
     console.log("Element with ID=Tile1 not found");
   }  

    <div id="Tile1" className="linkcontainer">Home</div>
/code

```

However, I cannot find an appropriate place to add the event-listener and the element with ID "Tile1" is never found - perhaps because it hasn't been rendered as yet?

The element in question is only rendered by index.js but I can't add a function after the reactDOM.render block in index.js - I get an error "not a react function"

Any suggestions would be much appreciated :-)