@samitouri / QOS-React-2 / commits / 362e56a1c1

Add comment about bug in yields

This needs to be fixed somehow. The reconciler could know if you are mounting this continuation into the same spot as before and then clone it. However, if the continuation moves, this info is lost. We'd try to unmount it in one place and mount the same fiber in another place.

Sebastian Markbage committed Sep 14, 2016 at 22:59 UTC 362e56a1c1d033b4dd5c289b98c2cf0b9fb921f7
1 file changed +5
src/renderers/shared/fiber/ReactFiber.js
+5
@@ -276,6 +276,11 @@ function createFiberFromElementType(type : mixed, key : null | string) {
276 fiber.type = type;
277 } else if (typeof type === 'object' && type !== null) {
278 // Currently assumed to be a continuation and therefore is a fiber already.
279 + // TODO: The yield system is currently broken for updates in some cases.
280 + // The reified yield stores a fiber, but we don't know which fiber that is;
281 + // the current or a workInProgress? When the continuation gets rendered here
282 + // we don't know if we can reuse that fiber or if we need to clone it.
283 + // There is probably a clever way to restructure this.
284 fiber = type;
285 } else {
286 throw new Error('Unknown component type: ' + typeof type);