Skip to content

Commit

Permalink
chore: remove warning when update unmounted component
Browse files Browse the repository at this point in the history
  • Loading branch information
SoloJiang committed Aug 23, 2021
1 parent fab69e2 commit afb049a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 128 deletions.
115 changes: 0 additions & 115 deletions packages/rax/src/__tests__/asyncUpdate.js

This file was deleted.

12 changes: 0 additions & 12 deletions packages/rax/src/vdom/updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,6 @@ function requestUpdate(component, partialState, callback) {
let internal = component[INTERNAL];

if (!internal) {
if (process.env.NODE_ENV !== 'production') {
// Block other render
Host.__isUpdating = false;
console.error(
"Warning: Can't perform a Rax state update on an unmounted component. This " +
'is a no-op, but it indicates a memory leak in your application. To ' +
'fix, cancel all subscriptions and asynchronous tasks in %s.',
component.__isReactiveComponent
? 'a useEffect cleanup function'
: 'the componentWillUnmount method',
);
}
return;
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/bench/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async function runBench(framework, benchmarks, local, skipBuild) {
try {
const benchmarkOptions = {
port: config.PORT.toFixed(),
headless: args.headless,
headless: args.headless || true,
chromeBinaryPath: args.chromeBinary,
numIterationsForAllBenchmarks: config.REPEAT_RUN,
numIterationsForStartupBenchmark: config.REPEAT_RUN_STARTUP
Expand Down

0 comments on commit afb049a

Please sign in to comment.