JavaScript React Basics (retired) Thinking in Components PropTypes and DefaultProps

amourief
amourief
5,469 Points

React "intellisense" / code suggestions doesn't show up for me in my own local environment - how do I enable this?

For example when I type the following: 'React.propTypes.' string is not suggested to me. Referring to where the code suggestions are showing for the course presenter when he types the code below.

Application.propTypes = { title: React.PropTypes. }

2 Answers

Chris Shaffer
Chris Shaffer
12,021 Points

I think what you are looking for is code completion - suggestions for common syntax, functions and keywords that appear in your code editor as you type.

If you're using Sublime Text there are a number of plugins for this but for React they are a bit dated. You can add them using Package Control.

I would suggest looking at Atom if you're going to continue with React. It has a lot of nice native support for React and JS in general and the Babel plugin will do nice highlighting of JSX syntax. There are a number of other plugins that will help with code completion for both JS and React. Atom was created by GitHub.

amourief
amourief
5,469 Points

Thank you Chris. I recently made the switch to Atom from Sublime and prefer using it over Sublime. I've found an Atom plugin that does code completion for React. Will have a look at the Babel plugin too.

Thanks again for your help :)

Chris Shaffer
Chris Shaffer
12,021 Points

No problem! If my answer helped please up vote and mark it as the best answer!