Skip to content

Commit d0a9b4e

Browse files
authored
Merge pull request #3296 from smith558/patch-4
Improve clarity and fix error
2 parents da4258b + 895db8d commit d0a9b4e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/content/1/en/part1c.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,10 +627,10 @@ const App = () => {
627627
628628
Since we now have an easily reusable <i>Button</i> component, we've also implemented new functionality into our application by adding a button that can be used to decrement the counter.
629629
630-
The event handler is passed to the <i>Button</i> component through the _handleClick_ prop. The name of the prop itself is not that significant, but our naming choice wasn't completely random.
630+
The event handler is passed to the <i>Button</i> component through the _onClick_ prop. The name of the prop itself is not that significant, but our naming choice wasn't completely random.
631631
632632
React's own official [tutorial](https://react.dev/learn/tutorial-tic-tac-toe) suggests:
633-
"In React, it’s conventional to use onSomething names for props which represent events and handleSomething for the function definitions which handle those events."
633+
"In React, it’s conventional to use onSomething names for props which take functions which handle events and handleSomething for the actual function definitions which handle those events."
634634
635635
### Changes in state cause rerendering
636636

0 commit comments

Comments
 (0)