javascriptcssvisual-studio-codeemmet

Emmet for React.js Classes: "styles.something"


I am a React developer using VSCode. When you type .hello, it inserts<div className="hello"></div>. However, that is useless because my classes are styles.something, and I import styles from a stylesheet. How can I make Emmet insert <div classsName={styles.hello}></div> when typing .hello?


Solution

  • You can type .{styles.hello}.

    Then you get <div className={styles.hello}></div>