React Life-Cycle Methods Flags as Unused

The inspection in WebStorm doesn't seem to recognize that the various React life-cycle methods (such as "getInitialState", "componentWillMount", etc.) are used. I can suppress the inspection by using the "//noinspection JSUnusedGlobalSymbols" comment, or completely disabling it in the settings. But I'm curious as to why WS doesn't do the same for "render" and if this is an indication of a configuration issue that I can address.

Comment actions Permalink

Please vote for The problem is that unused properties handling is based on static code analysis, so methods/properties that are not called explicitly and are only used by framework internals will be marked as unused. We have to add filters for all React stuff to avoid violations. For now I can only suggest suppressing inspection for these methods: Alt+Enter on method, hit Right, choose 'Suppress for statement'


Please sign in to leave a comment.