Making WebStorm supply correct JSX attributes for Preact project

Hi,

When using WebStorm with TypeScript and React it will correctly autocomplete attributes as "className" and "onClick". However I'm working with Preact right now and it keeps not only suggesting "onclick" but also replacing "onClick" with "onclick" when pasting (which TypeScript then proceeds to complain about).

I tried installing react package to trigger the correct behavior but it didn't help.

Is there some checkbox I'm missing? In fact, just reverting to TypeScript autocompletion in JSX would work fine as it works correctly in VSCode.

Thanks

 

Update:

Upon further inspection disabling the HTML DTD in "Default XML Schemas" makes WS have no completion on tags at all, but it still has it on <Components>. This makes me think WS specifically overrides TS completion behavior in this case. Why?

I also found that in the meantime *.jsx files work just fine. It's only *.tsx where this problem occurs.

0
1 comment

this would require adding a special support for Preact; please feel free to file a feature request for it to youtrack, https://youtrack.jetbrains.com/issues/WEB

0

Please sign in to leave a comment.