Closed toninorair closed 8 years ago
Please format code using Markdown (between ```js
and ````` lines), as not only formatting is off, but it also looks like some pieces were removed by Github's sanitizer.
The main idea of message that 'static propTypes` breaks further parsing
I see. This is in fact out of scope of this plugin - each plugin extends Acorn with some specific syntax, and you need to combine them if you want to use several unofficial features on top of JavaScript (like JSX or static properties).
Unfortunately, I'm not aware of a plugin that allows static properties at the moment, so can't help you with this one (maybe @Rich-Harris knows though?).
Closing as not related to the JSX plugin.
maybe @Rich-Harris knows though?
afraid not :(
If static properties were found in code, parsing does not work correctly, JsxElements aren't parsed correctly anymore. For example:
class B {} class A { static propTypes = { className: 1 }; render() { return ( <B></B> );}}
if propTypes statement if present, JsxElement 'B' isn't resolved correctly