title: Importing GeoJSON file to React-Leaflet
body: <p>I'm trying to import a GeoJSON file to react-leaflet like below:</p>
  
  <pre><code>import * as bar from "./data/bar.geojson";
  
  ...
  
  function Foo() {
    return (
      &lt;Map center={[...]} zoom={...}&gt;
        &lt;TileLayer
          ...
        /&gt;
        &lt;GeoJSON data={bar} /&gt;
      &lt;/Map&gt;
    );
  }
  
  export default Foo;
  </code></pre>
  
  <p>I'm getting "Error: Invalid GeoJSON object." for calling  <code>&lt;GeoJSON data={bar} /&gt;</code>. I hardcoded the same GeoJSON data to this javascript file and it worked, so it must be the way of importing or handling the GeoJSON file that is causing a problem.</p>
  
  <p>Does anyone have an idea of why I'm having an error? Thanks in advance!</p>