-
Notifications
You must be signed in to change notification settings - Fork 792
Closed
Description
Each component consist of 2 different pieces:
- Class methods. They exists on prototype and could be updated just by replacing the old prototype by a new one.
- Class properties. Their initiation occurs in class constructor.
To update second ones RHL creates 2 components - old and new, then compares all descriptors.
Comparison ignores "objects", thus keeps state untouched, and updates functions and simple variables.
But that does mean "updates functions"?
It literally cast function toString and then eval that code in the context of Class.
The problem
Casting function toString defines what is it, not how it was created.
Before, RHL did update, only if "text" got changes, but it was changed #949 and now they always got updated.
This causes #995, #978, #969, #984
RHL have rights only to update "own" functions, but could not detect them.
Solution
- Revert v4 does not use updated non-React modules #949
- Update "arrow" functions only if text got changed. Or if "this" keysword is found inside (probably should fix v4 does not use updated non-React modules #949 back)
- Update
bound
class methods. Ie those ones, which names exists on prototype.