Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to React 16 #37

Open
gurkerl83 opened this issue Sep 27, 2017 · 1 comment
Open

Update to React 16 #37

gurkerl83 opened this issue Sep 27, 2017 · 1 comment

Comments

@gurkerl83
Copy link

Hi,

I have just tried to update the react dependency of React to version 16.
This version of React separates DOM Factories from the react library (react-dom-factories). Also, I have updated react-router to a version which supports React 16.

Unfortunately, the example is not working anymore. There are multiple identical errors indicating a TypeError - Cannot read property 'toLowerCase' of undefined.

The source of the problem is the Function getRootHostContext(rootContainerInstance) in the ReactFiberReconciler.

This function gets called multiple times with different node Types.

The internal of the function creates a valid object (toLowerCase function is working) if the rootContainerInstance is of section type - section-todo-app (2x from the start in the example). The object is invalid if the rootContainerInstance is a document-fragment.

Any suggestions ...

Thanks!

@gurkerl83
Copy link
Author

Some update ...

I tried to fix this problem adding extending the following code in React 16 (react-dom)

Location:
File - ReactDOMFiberEntry.js
Section - ReactFiberReconciler
Function - getRootHostContext(rootContainerInstance)

From

if (rootContainerInstance.nodeType === DOCUMENT_NODE) {

To

if (rootContainerInstance.nodeType === DOCUMENT_NODE || rootContainerInstance.nodeType === DOCUMENT_FRAGMENT_NODE) {

Does this make any sense, because the example is working again!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant