Skip to content

Commit

Permalink
Remove concurrent APIs from stable builds
Browse files Browse the repository at this point in the history
Those who want to try concurrent mode should use the experimental
builds instead.

I've left the `unstable_` prefixed APIs in the Facebook build so we
can continue experimenting with them internally without blessing them
for widespread use.
  • Loading branch information
acdlite committed Oct 15, 2019
1 parent 09633e6 commit ccf2758
Show file tree
Hide file tree
Showing 31 changed files with 1,903 additions and 2,189 deletions.
35 changes: 19 additions & 16 deletions fixtures/dom/src/__tests__/wrong-act-test.js
Expand Up @@ -17,6 +17,7 @@ let TestRenderer;
let ARTTest;

global.__DEV__ = process.env.NODE_ENV !== 'production';
global.__EXPERIMENTAL__ = process.env.RELEASE_CHANNEL === 'experimental';

expect.extend(require('../toWarnDev'));

Expand Down Expand Up @@ -176,19 +177,21 @@ it("doesn't warn if you use nested acts from different renderers", () => {
});
});

it('warns when using createRoot() + .render', () => {
const root = ReactDOM.unstable_createRoot(document.createElement('div'));
expect(() => {
TestRenderer.act(() => {
root.render(<App />);
});
}).toWarnDev(
[
'In Concurrent or Sync modes, the "scheduler" module needs to be mocked',
"It looks like you're using the wrong act()",
],
{
withoutStack: true,
}
);
});
if (__EXPERIMENTAL__) {
it('warns when using createRoot() + .render', () => {
const root = ReactDOM.createRoot(document.createElement('div'));
expect(() => {
TestRenderer.act(() => {
root.render(<App />);
});
}).toWarnDev(
[
'In Concurrent or Sync modes, the "scheduler" module needs to be mocked',
"It looks like you're using the wrong act()",
],
{
withoutStack: true,
}
);
});
}

0 comments on commit ccf2758

Please sign in to comment.