2017-09-28 9 views
1

私のプロジェクトにreact-leafletcreate-react-appのスクリプトを統合しました。私はこれに従うexample未知のエラー:要素の種類が無効です:文字列の反応チラシ

すべてが動作しますが、私が使用しようとするとGeoJsonコンポーネントがインポートされた:私は次の警告を持って

import { Map, TileLayer, Popup, GeoJson } from 'react-leaflet' 

warning.js:35 Warning: React.createElement: 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 your code at index.js:47.

とエラー

Uncaught Error: 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 Leaflet

と私は地図上の領域を見ることができません。

これを修正するにはどうすればよいですか? ありがとう

答えて

1

最近の反応小冊子によると、 GeoJsonの代わりにGeoJSONをインポートしてください。 最近のリーフレットライブラリの変更に合わせるために変更されました。

関連する問題