0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

つまづき1 JSXを返すときのセミコロン

Posted at

UdemyのReact講座で少しつまづいたのでメモ

image.png

このようにセミコロンを消してくださいというエラーが出てしまったので原因を調査してみた

原因

セミコロンを書くことでreturn文の後のように使われていると判断されている

image.png

上のように{}とreturn文を省略せずに書くとエラーが消えたことが分かった

まとめ

JSXを返す場合: セミコロンは必要ない。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?