Imこのようなエラーが表示されます。未知のエラー:ルート(...):何もレンダリングから返されませんでした。これは通常、return文がないことを意味します。リターンルータはレンダリングコンポーネントではなく、返信文がありません。
import React from 'react';
import {BrowserRouter, Switch, Route, ReactDom} from 'react-router-dom'
import ProductsDisplay from './ProductsDisplay'
import Home from './Home'
import Contact from './Contact'
const Main =() => {
return (
<main>
<Switch>
<Route exact path="/" component={Home}/>
<Route exact path="/contact" component={Contact}/>
<Route exact path="/monitors" render={() => {<ProductsDisplay productCategory="monitors"/>}}/>
<Route exact path="/computers" render={() => {<ProductsDisplay productCategory="computers"/>}}/>
</Switch>
</main>
);
}
export default Main;
私はreturn文は、すべてのコンポーネントである確信して、任意のアイデアは、これができますか?
あなたのコンポーネントが正しくインポートされていない場合に発生することがあります。 – Sulthan