Reputation: 10360
I am writing a React
app using ES6
like so
import React, { Component } from 'react';
I have installed react via npm
, business as usual
npm install react --save-dev
It seems though that React
is written using CommonJs as
module.exports = React;
so IntelliJ (or WebStorm) will throw a warning
default export is not declared in imported module
which is kind of bugging me and also autocompletion won't work. Does anyone have a solution for this?
Upvotes: 1
Views: 2321
Reputation: 67
I am using Webstorm 2016.2. I don't know how to fix the warning but I was able to disable it. Use Alt-Enter and accept the fix. Here is the fix, notice the comment, that is the fix.
//noinspection TypeScriptCheckImport
import template from './app.html';
Upvotes: 2