React Named Imports Code Completion

Answered

Hi, I seem to be having an issue where using a named import for Component or PureComponent causes the code completion to stop working. However it does work when using React.Component or React.PureComponent.

 

For example code completion in the class below does not work:

import React, { Component } from 'react';

class Comp extends Component {

...

}

 

However when I do this the code completion does work:

import React from 'react';

class Comp extends React.Component {

...

}

 

I've tried installing @types/react under Settings > Languages & Frameworks > JavaScript > Libraries. Is there any way to get the code completion working for named imports that I'm missing?

Thanks!

3 comments
Comment actions Permalink

Hi Michael! 
Unfortunately, I can't reproduce the problem. 
Could you please update to Rider 2019.2.1 and check the issue? Also, please, does it appears on any new React project? Let me know if the problem persists.

0
Comment actions Permalink

I was already on Rider 2019.2.1. I spent some time messing around with the settings some more and found out removing the path to the webpack file under Settings > Languages & Frameworks > JavaScript > Webpack seemed to fix it.

0
Comment actions Permalink

Glad to hear you find an answer. Please, let us know if you have any other questions. 

0

Post is closed for comments.