Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JetBrains IDEs - How To Prevent IDE From Changing "Class" Attribute To "ClassName" In React Projects On Copy And Paste?

I work on a React project with my JetBrains IDE and most of the elements in my project are React components. I do however use the Ionic Icons library and when I need to insert an icon into my component, I use something like:

<ion-icon class="icon" name="chevron-forward-outline"/>

Since the Ionic elements are not React components, it uses the class attribute as opposed to the className attribute. Every time I copy and paste an Ionic element like the one above, my JetBrains IDE automatically changes the class attribute to className.

How do I prevent the IDE from doing this?

like image 863
Lloyd Banks Avatar asked Jan 22 '26 20:01

Lloyd Banks


1 Answers

please try disabling Convert HTML when pasting into JSX files (convert attributes, close single tags) in Settings | Editor | General | Smart Keys | JavaScript

like image 56
lena Avatar answered Jan 25 '26 06:01

lena



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!