Email or username:

Password:

Forgot your password?
Top-level
Alexander The 1st

@shellheim @mjk This does beg the question still though; why *does* the variable exist? What does it actually do that it needs to exist, but *also* indicate that you will be fired if you use it?

It also presumes that ever developer is proficient in English.

2 comments
Imran Nazar

@AT1ST @shellheim @mjk The variable exists because React needs some way to pass around internal state; it has a scary name because all variable names in the code are visible and developers will latch onto any undocumented state value that has the thing they need at that moment, and complain when it moves or breaks.

It's the reason the Windows APIs are such a mess: they have to maintain bugs in the old versions that some program happens to rely on.

Relevant xkcd: xkcd.com/1172/

Alexander The 1st

@Two9A @shellheim @mjk I guess my next question is why it is such a large encompassing internal state variable, and they didn't instead go with "__INTERNAL_STATE_X" and "__INTERNAL_STATE_Y" for individual X and Y parts of the internal state.

Instead it's one *giant* "Do Not Touch" variable that does not explain *why* it needs to exist.

Go Up