i tried testing the rc with react-three-fiber, it crashed. so tried with a super reduced minimal renderer, here's the link for testing it: https://codesandbox.io/s/reurope-reconciler-forked-wikus?file=/src/App.js:418-492
change the color in line 13 from hotpink to something else and it crashes the reconciler

going through the stack trace it passes focusedInstanceHandle to doesFiberContain, but it is undefined
function commitBeforeMutationEffects() {
...
if (doesFiberContain(nextEffect, focusedInstanceHandle)) {
this now causes trouble in doesFiberContain which checks against null, but not undefined
function doesFiberContain(parentFiber, childFiber) {
var node = childFiber; // undefined
while (node !== null) {
...
node = node.return;
I think if you return null from prepareToCommit that would fix it.
(Maybe this is a good argument to make the check looser.)
indeed that fixed it! are there any other places it needs null?
looks better now in r3f, too. it started to run - for a while - then it wipes out the complete content of a useRef, where i keep my state. will make a new new issue if im certain im not the one causing it.
Not aware of other places. If you narrow it down, file for sure!
@gaearon turns out this was related to https://reactjs.org/blog/2020/08/10/react-v17-rc.html#potential-issues (the new useEffect timing). some thing wanted to rely on state, which was disposed earlier.
You can useLayoutEffect if being sync is important.
I think if you return
nullfromprepareToCommitthat would fix it.
That's prepareForCommit not prepareToCommit :) I just blindly copy-pasted it and was really sad, when it didn't work. Luckily I double-checked the name and saw the problem ... and now it works! Thanks @gaearon.
I added some docs today:
https://github.com/facebook/react/tree/master/packages/react-reconciler#an-incomplete-reference
@gaearon cool thanks! Already bookmarked :)
Most helpful comment
I added some docs today:
https://github.com/facebook/react/tree/master/packages/react-reconciler#an-incomplete-reference