Chapter 3 discussion
The bronze challenge turns out to be more challenging than expected, as the Chrome console apparently only shows the onMouseEnter and onMouseLeave after a click event. This is not an issue in Safari.
Interesting, I used Brave (v 1.59.122) and did not have that issue.
Bronze Challenge: Hello, Goodbye
As I’m working through the challenges, posting my solutions - any comments/suggestions welcome.
src/Post.js
+ const handleMouseEnter = (otterName) => {
+ return console.log('Mouse entered ' + otterName)
+ }
+
+ const handleMouseLeave = (otterName) => {
+ return console.log('Mouse left ' + otterName)
+ }
+
return(
<li className='post-component'>
- <button onClick={() => handleClick(name)}>
+ <button onClick={() => handleClick(name)}
+ onMouseEnter={() => handleMouseEnter(name)}
+ onMouseLeave={() => handleMouseLeave(name)} >