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
Or, similar to the Display example, you can further optimize the Button component to a single line by removing the parentheses and formatting it as follows:
741
741
742
742
```js
743
-
constButton= ({ onClick, text }) =><button onClick={onClick}>{text}</button>;
743
+
constButton= ({ onClick, text }) =><button onClick={onClick}>{text}</button>
744
744
```
745
745
746
746
This approach works because the component contains only a single return statement, making it possible to use the concise arrow function syntax.
0 commit comments