File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -755,7 +755,7 @@ const Button = ({ onSmash, text }) => (
755755We can simplify the Button component once more by declaring the return statement in just one line:
756756
757757` ` ` js
758- const Button = ({ onSmash, text }) => < button onSmash = {onSmash}> {text}< / button>
758+ const Button = ({ onSmash, text }) => < button onClick = {onSmash}> {text}< / button>
759759` ` `
760760
761761**NB**: However, be careful to not oversimplify your components, as this makes adding complexity a more tedious task down the road.
Original file line number Diff line number Diff line change @@ -716,7 +716,7 @@ const Button = ({ onSmash, text }) => (
716716Nous pouvons simplifier une fois de plus le composant Button en déclarant l'instruction de retour en une seule ligne :
717717
718718` ` ` js
719- const Button = ({ onSmash, text }) => < button onSmash = {onSmash}> {text}< / button>
719+ const Button = ({ onSmash, text }) => < button onClick = {onSmash}> {text}< / button>
720720` ` `
721721
722722**NB** : Cependant, veillez à ne pas trop simplifier vos composants, car cela rend l'ajout de complexité plus fastidieux par la suite.
You can’t perform that action at this time.
0 commit comments