简体   繁体   中英

How to get auto-suggestion when we style a components inside react.js file?

When we style elements using the app.css or styles.css, vs code simply auto suggest us. example if we type just "back" for background colour, it auto suggest us to complete. but in react.js or index.js it won't work. Why? is there any idea or solution for this? An extension or something. Please excuse my poor english.

solution for this auto-suggestion/auto-complete of this.

In vs code the suggestions are based on the file extension. Therefore, in a js file the vs code only expect JavaScript and it gives suggestions on that. You can use commonly available react extension like ES7+ React/Redux/React-Native snippets for getting react snippets, component name autocomplete.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM