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?

More than 1 year has passed since last update.

【Reactチュートリアル:三目ならべ】has already been declared の原因と解決方法

Posted at

has already been declared.の原因と解決

起きたこと

Reactチュートリアルで三目ならべの「もう一度Stateをリフトアップ」の項目をやっていた時に、以下のようなエラーが出た。

スクリーンショット 2024-02-19 19.36.14.png

Cannot assign to read only property 'message' of object 'SyntaxError: /src/App.js: Identifier 'xIsNext' has already been declared.

原因

エラー内容的には、「変数がすでに宣言されてます」が原因。

解決方法

xIsNextという変数が2回定義されていた。
一方を削除したら解消された。

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?