Skip to content
This repository was archived by the owner on Dec 31, 2020. It is now read-only.

Upgrade React to 16.9#199

Closed
danielkcz wants to merge 1 commit intomasterfrom
react-169
Closed

Upgrade React to 16.9#199
danielkcz wants to merge 1 commit intomasterfrom
react-169

Conversation

@danielkcz
Copy link
Copy Markdown
Collaborator

@danielkcz danielkcz commented Aug 9, 2019

Something has changed in React that's causing one test to fail. I've spent quite some time to figure it out, but I have no idea. I've extracted the failing portion to sandbox and hoping for an extra pair of eyes to see to the problem...

https://codesandbox.io/s/little-fire-2k5ow?expanddevtools=1&fontsize=14&module=%2Fsrc%2Ferror.test.tsx&previewwindow=tests

I tried changing the following line to createElement(component, props) but it breaks a whole lot of other tests simply because useObserver cannot see into a nested component.

return component(props)

image

cc @mweststrate @urugator @xaviergonz

Fixes #195 #196 #198

@mweststrate
Copy link
Copy Markdown
Member

mweststrate commented Aug 16, 2019 via email

@danielkcz
Copy link
Copy Markdown
Collaborator Author

Yep, still stuck, no idea what's the problem here.

@danielkcz
Copy link
Copy Markdown
Collaborator Author

danielkcz commented Aug 23, 2019

Ok, I had a fresh new look at this and something really interesting/strange is happening here. Feels like some partial concurrent mode got into 16.9 or whatnot.

What happens is when an error is thrown from the observed component, it is caught for reaction disposal and then rethrown again - that is fine.

However, React does another re-render afterward where Reaction is already disposed so the rendering is skipped and ultimately it returns undefined as the initial value of rendering variable.

I will try to isolate this to pure React and possibly report an issue with them.

@danielkcz
Copy link
Copy Markdown
Collaborator Author

danielkcz commented Aug 23, 2019

Aha! It seems when I use the code for useObserver from the next branch, it actually passes a test with React 16.9. It's indeed concurrent more related.

So I am thinking we will expedite the release of 2.0 as per #121 (comment) there might be potentially breaking changes. The 1.x will stick to 16.8.

I wonder though if we need to publish mobx-react@7 as well. It's really hard to guess how breaking that change is. I will also remove those deprecated hooks, but they were never reexported in mobx-react.

@danielkcz danielkcz mentioned this pull request Aug 23, 2019
@danielkcz danielkcz closed this Oct 14, 2019
@danielkcz danielkcz deleted the react-169 branch February 16, 2020 16:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants