-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sebastian Silbermann
committed
Aug 14, 2023
1 parent
56031d9
commit f518c7c
Showing
1 changed file
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -195,8 +195,8 @@ const App = ({ message }: AppProps): JSX.Element => <div>{message}</div>; | |
// you can also inline the type declaration; eliminates naming the prop types, but looks repetitive | ||
const App = ({ message }: { message: string }) => <div>{message}</div>; | ||
|
||
// Alternatively, you can use `React.FunctionComponent` (or the shorthand `React.FC`), if you prefer. | ||
// With latest React types (earliest is `@types/[email protected]`) and TypeScript 5.1. it's mostly a stylistic choice, otherwise discouraged. | ||
// Alternatively, you can use `React.FunctionComponent` (or `React.FC`), if you prefer. | ||
// With latest React types and TypeScript 5.1. it's mostly a stylistic choice, otherwise discouraged. | ||
const App: React.FunctionComponent<{ message: string }> = ({ message }) => ( | ||
<div>{message}</div> | ||
); | ||
|