2017-08-08 16 views
0

tabs from semantic-uiをNext.jsアプリケーションに実装しようとしています。Next.jsとSemantic UI、Tab要素、エラー:要素タイプが無効です

私はこのエラーを取得しています:

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in. Check the render method of TabExampleBasic .

これはコードです:

import React from 'react' 
import { Tab } from 'semantic-ui-react' 

const panes = [ 
    { menuItem: 'Tab 1', render:() => <Tab.Pane>Tab 1 Content</Tab.Pane> }, 
    { menuItem: 'Tab 2', render:() => <Tab.Pane>Tab 2 Content</Tab.Pane> }, 
    { menuItem: 'Tab 3', render:() => <Tab.Pane>Tab 3 Content</Tab.Pane> }, 
] 

const TabExampleBasic =() => (
    <Tab panes={panes} /> 
) 

export default TabExampleBasic 

私はページ/ index.jsに、このコンポーネントをインポート。 Card、Grid、Accordionのようなsemantic-uiの他のコンポーネントは面倒なく動作します。

私は、この例で働いています:https://github.com/zeit/next.js/tree/master/examples/with-semantic-ui

+0

「semantic-ui-react」は正しくインストールされていますか?インポート後に 'console.log(Tab);'を試してください。ここに未定義が表示されている場合は問題です。 –

+0

あなたが正しいです、問題があります。私はそれを再インストールし、今すぐ動作します。 – danieljacky

答えて

0

Tabコンポーネントは、あなたがこのバージョン以降を実行していることを確認し、0.70.0に追加されました。

関連する問題