You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is probably a Typo or a wrong statement that needs to be corrected.
You can rename the function to whatever you like when passing through as props, the prop name and value do not need to be the same. We could just as easily write superCoolFunction={handleButtonClick}.
I don't know the reason why this was mentioned. The prop name and value were never the same in this lesson, and if you were to change the prop name in this case, handleClick to superCoolFunction you'll have to change the prop name in the Button function.
Thanks for opening this issue @reda777. That bullet in the lesson is correct - it's just reinforcing the fact that the prop name can be anything and doesn't have to match the name of the function you're passing in. That being said, I can definitely see where the confusion is coming from and that bullet can be worded more clearly. e.g.
The prop name does not have to match the name of the function passed in. You can see we've called the prop handleClick instead of handleButtonClick, and we could also have called the prop superCoolFunction if we wanted.
Yeah I was confused reading it. The note could be useful if the snippet code included something like handleClick={handleClick}, but I don't think it's necessary to state if the code already demonstrates that point. If you still want to keep the note, a clearer version like the one you wrote should be fine I think. Thanks for taking the time to reply.
Yeah, I don't think we need to be that explicit with a same-name example. I agree the current wording does make it sound like a brand new point rather than a reinforcing of what's already been shown. I'll assign this to you 🚀
Checks
Describe your suggestion
There is probably a Typo or a wrong statement that needs to be corrected.
I don't know the reason why this was mentioned. The prop name and value were never the same in this lesson, and if you were to change the prop name in this case,
handleClick
tosuperCoolFunction
you'll have to change the prop name in the Button function.Path
Node / JS
Lesson Url
https://www.theodinproject.com/lessons/node-path-react-new-passing-data-between-components
(Optional) Discord Name
No response
(Optional) Additional Comments
No response
The text was updated successfully, but these errors were encountered: