Protected member is not accessible, React Native functions

WebStorm 2018.1
Build #WS-181.4203.535, built on March 22, 2018
JRE: 1.8.0_152-release-1136-b20 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.2


After updating to WebStorm 2018.1 all usages of setState() and forceUpdate() inside of a React Native project prompt the 'protected member is not accessible' warning.


This issue persists both when the state is previously defined in the constructor, and when initially setting the state. All instances of setState() reflect this warning.

All calls to forceUpdate() prompt the warning.

Attempted Resolution:

Invalidate caches | Restart

Comment actions Permalink

Please provide code snippets/files I can use to recreate the issue

Comment actions Permalink

I am getting the same error in all files, after upgrading.




Comment actions Permalink

can't recreate using similar syntax:

what react-native version do you use? Can you recreate the issue using the basic React Native project created via File | New | Project...?

Comment actions Permalink


I am able to recreate using a new project. Additionally I created the test project on another system to rule out local settings.

Test Project:

"react-native": "0.54.4"

Current Project:

"react-native": "^0.52.2"

Comment actions Permalink

Yep, was able to recreate it as well, tried on a fresh computer at work. I was on react native 0.52.0 or something, and we upgraded our react and react native to latest version, issue persists.


This is really throwing us off seeing so many warnings. How do we temporarily disable this warning until a fix is out, or we resolve what the actual problem is?

Comment actions Permalink


If you would like to disable the protected member warnings it can be disabled in the inspection preferences.

Preferences -> Editor -> Inspections -> Javascript -> General

uncheck '@private and @protected members accessibility'

Comment actions Permalink

thanks, recreated with most recent react-native+react; logged as, please follow it for updates


Please sign in to leave a comment.