Skip to content

Commit

Permalink
Remove integration with react-dev-tools tracing, it no longer exists
Browse files Browse the repository at this point in the history
Was removed in React 17 facebook/react#20037
  • Loading branch information
jordanhennell committed Jun 6, 2022
1 parent 09cd000 commit c8c119f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
1 change: 0 additions & 1 deletion packages/event-reduce-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"react": ">=18"
},
"devDependencies": {
"@types/scheduler": "*",
"@types/react": ">=18",
"typescript": "~4"
}
Expand Down
8 changes: 4 additions & 4 deletions packages/event-reduce-react/src/rendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import { Unsubscribe, watch } from "event-reduce";
import { log, sourceTree } from "event-reduce/lib/logging";
import { collectAccessedValues, ObservableValue } from "event-reduce/lib/observableValue";
import { reactionQueue } from "event-reduce/lib/reactions";
import { createElement, forwardRef, ForwardRefExoticComponent, ForwardRefRenderFunction, Fragment, FunctionComponent, memo, MemoExoticComponent, PropsWithChildren, PropsWithoutRef, ReactElement, ReactNode, RefAttributes, RefForwardingComponent, useRef, useState, ValidationMap, WeakValidationMap } from "react";
import { createElement, forwardRef, ForwardRefExoticComponent, ForwardRefRenderFunction, Fragment, FunctionComponent, memo, MemoExoticComponent, PropsWithChildren, PropsWithoutRef, ReactElement, ReactNode, RefAttributes, useRef, useState, ValidationMap, WeakValidationMap } from "react";
import { useAsObservableValues } from "./hooks";
import { trace } from "./trace";
import { useDispose } from "./utils";

interface ContextlessFunctionComponent<P = {}> {
Expand Down Expand Up @@ -72,8 +71,9 @@ export function useReactive<T>(nameOrDeriveValue: string | (() => T), maybeDeriv
let cancelReaction = undefined as Unsubscribe | undefined;
let stopWatching = watcher.subscribe(changed => {
unsubscribeFromThisRender(); // Avoid queueing up extra renders if more sources change
cancelReaction = reactionQueue.current.add(() => trace(`${name} reacted to ${changed.displayName}`, performance.now(),
() => setRerenderCount(c => c + 1)));
cancelReaction = reactionQueue.current.add(() =>
setRerenderCount(c => c + 1)
);
});

return value;
Expand Down
4 changes: 0 additions & 4 deletions packages/event-reduce-react/src/trace.ts

This file was deleted.

0 comments on commit c8c119f

Please sign in to comment.