画面にHello Worldを表示させたいのですが、何も表示されません。
コードは以下の通りになります。
よろしくお願いします。
エラーが出ていたので書いておきます。
index.js:2178 Warning: Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it. in Color (at App.js:8) in App (at index.js:7)
App.js
import React, { Component } from 'react'; import './App.css'; import Color from './Color' class App extends Component { render() { return ( <Color /> ); } } export default App;
Color.js
import React, {Component} from 'react'; class Color extends Component { render () { return ( function Color() { return <p>hello world!</p>; } ); } } export default Color
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2018/06/24 10:26
2018/06/24 14:15 編集
退会済みユーザー
2018/06/25 05:25
2018/06/25 05:51
退会済みユーザー
2018/06/25 06:05