Q:

Expected `onClick` listener to be a function, instead got a value of `string` type

Warning: Expected onClick listener to be a function, instead got a
  value of string type.
      in span (at App.js:62)
      in div (at App.js:61)
      in form (at App.js:60)
      in div (at App.js:58)
      in div (at App.js:46)
      in App (at index.js:8)

I am getting this error in App.js when i try to get the onclick event for button..
<h2>Login From Here..!</h2>

                <button onClick={document.getElementById('id01')}>Login</button>

Can anyone explain me how to get rid from this error?

A:

This is not a function:
document.getElementById('id01')

It's a function call, so whatever is returned from this function is a value, and that value gets converted to a String and then passed to your onClick. Instead, use something like this:
event => document.getElementById('id01')

or this more long-form version:
function( event ){

    return document.getElementById('id01');

}

It's still useless, as it will return the element to... nowhere and that's it, but at least it gets rid of your Error.

