I have an element with a ref that is defined and ends up getting rendered into the page :
ref
... <
Instead of putting your Console.log inside the function example(){...} you should put it inside:
example(){...}
example=()=>{....}