Skip to content

Commit

Permalink
Revert "Enable Concurrent Mode"
Browse files Browse the repository at this point in the history
This reverts commit 84cf875.

See: facebook/react#16773
  • Loading branch information
brunolemos committed Sep 15, 2019
1 parent 737d43e commit da99b92
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 114 deletions.
10 changes: 6 additions & 4 deletions packages/components/src/components/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { StrictMode } from 'react'
import React, { Fragment } from 'react'

import '../libs/analytics'

Expand All @@ -12,11 +12,13 @@ import { UnreadCountProvider } from './context/UnreadCountContext'

enableNetworkInterceptors()

// TODO: Fix StrictMode warnings
// TODO: Enable StrictMode after react-native fixes it
// @see https://github.com/facebook/react-native/issues/22186
const StrictModePlaceholder = Fragment

export function App() {
return (
<StrictMode>
<StrictModePlaceholder>
<ErrorBoundary>
<AppProviders>
<AppGlobalStyles key="app-global-styles" />
Expand All @@ -27,6 +29,6 @@ export function App() {
</UnreadCountProvider>
</AppProviders>
</ErrorBoundary>
</StrictMode>
</StrictModePlaceholder>
)
}
110 changes: 0 additions & 110 deletions patches/react-native-web+0.11.7.patch
Original file line number Diff line number Diff line change
@@ -1,113 +1,3 @@
diff --git a/node_modules/react-native-web/dist/cjs/exports/render/index.js b/node_modules/react-native-web/dist/cjs/exports/render/index.js
index 97d04e1..f5fce9a 100644
--- a/node_modules/react-native-web/dist/cjs/exports/render/index.js
+++ b/node_modules/react-native-web/dist/cjs/exports/render/index.js
@@ -1,7 +1,7 @@
"use strict";

exports.__esModule = true;
-exports.default = void 0;
+exports.default = render;

var _reactDom = require("react-dom");

@@ -13,6 +13,10 @@ var _reactDom = require("react-dom");
*
*
*/
-var _default = _reactDom.render;
-exports.default = _default;
+function render(element, container, callback) {
+ var isDevelopment = process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test';
+ if (isDevelopment) console.log('Concurrent Mode enabled.');
+ (0, _reactDom.unstable_createRoot)(container).render(element);
+}
+
module.exports = exports.default;
\ No newline at end of file
diff --git a/node_modules/react-native-web/dist/cjs/modules/hydrate/index.js b/node_modules/react-native-web/dist/cjs/modules/hydrate/index.js
index fa99e9c..ce69415 100644
--- a/node_modules/react-native-web/dist/cjs/modules/hydrate/index.js
+++ b/node_modules/react-native-web/dist/cjs/modules/hydrate/index.js
@@ -1,7 +1,7 @@
"use strict";

exports.__esModule = true;
-exports.default = void 0;
+exports.default = hydrate;

var _reactDom = require("react-dom");

@@ -13,6 +13,12 @@ var _reactDom = require("react-dom");
*
*
*/
-var _default = _reactDom.hydrate;
-exports.default = _default;
+function hydrate(element, container, callback) {
+ var isDevelopment = process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test';
+ if (isDevelopment) console.log('Concurrent Mode enabled.');
+ (0, _reactDom.unstable_createRoot)(container, {
+ hydrate: true
+ }).render(element);
+}
+
module.exports = exports.default;
\ No newline at end of file
diff --git a/node_modules/react-native-web/dist/exports/render/index.js b/node_modules/react-native-web/dist/exports/render/index.js
index 0dc4180..4046329 100644
--- a/node_modules/react-native-web/dist/exports/render/index.js
+++ b/node_modules/react-native-web/dist/exports/render/index.js
@@ -6,5 +6,9 @@
*
*
*/
-import { render } from 'react-dom';
-export default render;
\ No newline at end of file
+import { unstable_createRoot } from 'react-dom';
+export default function render(element, container, callback) {
+ var isDevelopment = process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test';
+ if (isDevelopment) console.log('Concurrent Mode enabled.');
+ unstable_createRoot(container).render(element);
+}
\ No newline at end of file
diff --git a/node_modules/react-native-web/dist/modules/hydrate/index.js b/node_modules/react-native-web/dist/modules/hydrate/index.js
index d59cecb..65e5b88 100644
--- a/node_modules/react-native-web/dist/modules/hydrate/index.js
+++ b/node_modules/react-native-web/dist/modules/hydrate/index.js
@@ -6,5 +6,11 @@
*
*
*/
-import { hydrate } from 'react-dom';
-export default hydrate;
\ No newline at end of file
+import { unstable_createRoot } from 'react-dom';
+export default function hydrate(element, container, callback) {
+ var isDevelopment = process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test';
+ if (isDevelopment) console.log('Concurrent Mode enabled.');
+ unstable_createRoot(container, {
+ hydrate: true
+ }).render(element);
+}
\ No newline at end of file
diff --git a/node_modules/react-native-web/dist/vendor/react-native/Batchinator/index.js b/node_modules/react-native-web/dist/vendor/react-native/Batchinator/index.js
index e6b3b4a..ae6c22f 100644
--- a/node_modules/react-native-web/dist/vendor/react-native/Batchinator/index.js
+++ b/node_modules/react-native-web/dist/vendor/react-native/Batchinator/index.js
@@ -72,6 +72,11 @@ function () {
return;
}

+ if (!this._delay) {
+ _this._callback();
+ return;
+ }
+
var timeoutHandle = setTimeout(function () {
_this._taskHandle = InteractionManager.runAfterInteractions(function () {
// Note that we clear the handle before invoking the callback so that if the callback calls
diff --git a/node_modules/react-native-web/dist/vendor/react-native/VirtualizedList/index.js b/node_modules/react-native-web/dist/vendor/react-native/VirtualizedList/index.js
index c08437e..4bc0ae2 100644
--- a/node_modules/react-native-web/dist/vendor/react-native/VirtualizedList/index.js
Expand Down

0 comments on commit da99b92

Please sign in to comment.