Guy
Guy

Reputation: 13336

Making WebStorm add style={} instead of style=""

Working on React with WebStorm I'd love to set up WebStorm's code completion to offer:

<div style={}...

instead of:

<div style=""...

Any way to achieve this behaviour?

Upvotes: 2

Views: 48

Answers (1)

Brandon
Brandon

Reputation: 39212

Upgrade to 2016.2. It does that now.

From their What's new:

WebStorm can now provide code completion and resolve for component properties defined using propTypes. For React events the IDE will automatically add {} instead of "". Non-DOM attributes are no longer marked as unresolved, and similarly, component lifecycle methods are not marked as unused anymore.

Upvotes: 3

Related Questions