roact
roact copied to clipboard
Pass props and state through render
Closes #199
Checklist before submitting:
- [x] Added entry to
CHANGELOG.md - [x] Added/updated relevant tests
- [x] Added/updated documentation
Coverage remained the same at 93.525% when pulling 1f2f16251ed35d06ca3fc6c4a3f81fd3b98f096c on Kampfkarren:pass-props-react into deaa8000220252f6edc27ec15e5704266560ebe5 on Roblox:master.
This still looks good to me, but I did some digging into why React doesn't do this, and here's what I found: https://github.com/reactjs/rfcs/pull/4#issuecomment-412637588
It's a pretty important point to make! Is it something we're worried about for Roact? Is it something we think we'll need to worry about? I may be missing something, but I think the closing-over-this problem they're talking about applies pretty equivalently to Lua as well as JS
One more thing to note as a followup: we do also have the same problem already with closing over initial props passed into init, so we should keep that in mind as well when we consider this.