dillon1000/react
Commit
Browse files Extract setState, setProps etc into ReactUpdateQueue
I originally did this work so that we could allow setState to be called before the internal ReactCompositeComponent was constructed. It's unlikely that we'll go down that route now but this still seems like a better abstraction. It communicates that this is not immediately updating an object oriented class. It's just a queue which a minor optimization. It also avoids bloating the ReactCompositeComponent file. Since they both depend on the life cycle I break that out into a common shared dependency. In a follow up I'll refactor the life-cycle management.
Changed paths10 files
First-parent comparisonsrc/browser/ui/ReactMount.js ModifiedM src/classic/class/ReactClass.js ModifiedM src/core/ReactCompositeComponent.js ModifiedA src/core/ReactLifeCycle.js AddedA src/core/ReactUpdateQueue.js AddedM src/core/ReactUpdates.js ModifiedM src/core/__tests__/ReactComponentLifeCycle-test.js ModifiedM src/core/__tests__/ReactCompositeComponent-test.js ModifiedM src/core/__tests__/ReactCompositeComponentState-test.js ModifiedM src/modern/class/ReactComponentBase.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…