30
5

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 5 years have passed since last update.

よく分からないReactエラーメッセージ [メモ]

Last updated at Posted at 2019-08-30

React/JSX特有のエラーメッセージは、明確になぜいけないのか教えてくれていることが少ない気がします。

#####sono1

does not exist on type 'JSX.IntrinsicElements'.  TS2339

以下のコードで怒られました。

render(){
return ( <test /> )
}

let test = () => { 
    return (<Grid>aa</Grid>);
}

なにがいけないのかさっぱりわからなかったのですが、関数コンポーネント名の最初
の文字を大文字にしたら、普通にコインパイル通りました。

#####sono2

Expected an assignment or function call and instead saw an expression  no-unused-expressions

[JSXタグ]をReturnで返していない

let test = () => { 
    (<Grid>aa</Grid>);
}
30
5
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
30
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?