I found small mistake in "e for event arguments":
This won't work because you pass string as an argument
const clickHandler = (e) => console.log(e.target) function App(){ return ( <> <h1>Welcome to my app</h1> <button onClick={() => clickHandler(*'Hello World'*)}>Say Hi</button> </> ) }
There are two ways how to do it: 1.
const clickHandler = (e) => console.log(e.target) function App(){ return ( <> <h1>Welcome to my app</h1> <button onClick={(e) => clickHandler(e)}>Say Hi</button> </> ) }
2.
const clickHandler = (e) => console.log(e.target) function App(){ return ( <> <h1>Welcome to my app</h1> <button onClick={clickHandler}>Say Hi</button> </> ) }
Ok thanks I made the correction
Exactly
Thanks! Will use
thanks--helpful post.
there's a typo: import {Greeting} from './Gretting'
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I found small mistake in "e for event arguments":
This won't work because you pass string as an argument
There are two ways how to do it:
1.
2.
Ok thanks I made the correction
Exactly
Thanks! Will use
thanks--helpful post.
there's a typo: import {Greeting} from './Gretting'