I am working on a React web application and recently upgraded from WebStorm 10 to 2016.1. I am pleased with the new version so far, with the exception of a few inspirational quirks, which I would prefer not to attend if I can help, one of which I could not find a fix.
I use ES6 classes to declare all of my React components, and in every instance where I set the state, WebStorm throws an unresolved variable warning in the method .state.
The code for the fragment in question:
import React from "react";
import autobind from 'autobind-decorator';
@autobind
class List extends React.Component{
constructor() {
super();
this.state = {
name: "List",
items: {},
history: {},
suggestions: [],
highlightIndex: 0,
suggestionsHover: false,
autoDelete: true,
delta: 0,
mouse: 0,
isPressed: false,
lastPressed: 0,
order: []
}
}
Warning:
Unresolved variable state
, WebStorm 10 (.. .setState). , babelify ES5, autobind-decorator, .
. , .