Summary:
This fixes a bug where a ref to a class would get nulled after the class is edited. Now it's appopriately updated.
This is technically a partial sync on top of my last cherry-picked one. It only picks up this commit: https://github.com/facebook/react/commit/9914a19190296ca7e0fd65f7c4f6fe5cc42e29a4. The changes are DEV-only and only affect Fast Refresh.
Reviewed By: motiz88
Differential Revision: D16543751
fbshipit-source-id: c1fc393e78d0e13070721037d16734c9ece38bc9