diff --git a/types/react-reconciler/ReactFiber.d.ts b/types/react-reconciler/ReactFiber.d.ts index 5e6eb448ac..6ea29c798b 100644 --- a/types/react-reconciler/ReactFiber.d.ts +++ b/types/react-reconciler/ReactFiber.d.ts @@ -51,7 +51,7 @@ export interface Fiber { // The ref last used to attach this node. // I'll avoid adding an owner field for prod and model that as functions. - ref: null | (((handle: unknown) => void) & { _stringRef: string | null | undefined }) | RefObject; + ref: null | (((handle: any) => void) & { _stringRef: string | null | undefined }) | RefObject; // Input is the data coming into process this fiber. Arguments. Props. pendingProps: any; // This type will be more specific once we overload the tag. @@ -64,7 +64,7 @@ export interface Fiber { memoizedState: any; // A linked-list of contexts that this fiber depends on - firstContextDependency: ContextDependency | null; + firstContextDependency: ContextDependency | null; // Bitfield that describes properties about the fiber and its subtree. E.g. // the AsyncMode flag indicates whether the subtree should be async-by- diff --git a/types/react-reconciler/ReactFiberNewContext.d.ts b/types/react-reconciler/ReactFiberNewContext.d.ts index 88abd8f8bb..a212df9839 100644 --- a/types/react-reconciler/ReactFiberNewContext.d.ts +++ b/types/react-reconciler/ReactFiberNewContext.d.ts @@ -3,5 +3,5 @@ import { ReactContext } from './ReactTypes'; export interface ContextDependency { context: ReactContext; observedBits: number; - next: ContextDependency | null; + next: ContextDependency | null; } diff --git a/types/react-reconciler/ReactFiberReconciler.d.ts b/types/react-reconciler/ReactFiberReconciler.d.ts index 9b760a4cc6..ca2296bfa4 100644 --- a/types/react-reconciler/ReactFiberReconciler.d.ts +++ b/types/react-reconciler/ReactFiberReconciler.d.ts @@ -240,7 +240,7 @@ export interface Reconciler { ): R; interactiveUpdates(fn: (a: A, b: B) => R, a: A, b: B): R; flushInteractiveUpdates(): void; - flushControlled(fn: () => unknown): void; + flushControlled(fn: () => any): void; flushSync(fn: (a: A) => R, a: A): R; // Used to extract the return value from the initial render. Legacy API. diff --git a/types/react-reconciler/ReactFiberRoot.d.ts b/types/react-reconciler/ReactFiberRoot.d.ts index 64ab2328cc..0117eb9d51 100644 --- a/types/react-reconciler/ReactFiberRoot.d.ts +++ b/types/react-reconciler/ReactFiberRoot.d.ts @@ -6,7 +6,7 @@ import { Interaction } from './Tracking'; export interface Batch { _defer: boolean; _expirationTime: ExpirationTime; - _onComplete: () => unknown; + _onComplete: () => any; _next: Batch | null; } diff --git a/types/react-reconciler/ReactUpdateQueue.d.ts b/types/react-reconciler/ReactUpdateQueue.d.ts index ec3381a410..497ce9f0f6 100644 --- a/types/react-reconciler/ReactUpdateQueue.d.ts +++ b/types/react-reconciler/ReactUpdateQueue.d.ts @@ -5,7 +5,7 @@ export interface Update { tag: 0 | 1 | 2 | 3; payload: any; - callback: (() => unknown) | null; + callback: (() => any) | null; next: Update | null; nextEffect: Update | null; diff --git a/types/react-reconciler/index.d.ts b/types/react-reconciler/index.d.ts index bb1efeaead..109f243a88 100644 --- a/types/react-reconciler/index.d.ts +++ b/types/react-reconciler/index.d.ts @@ -2,7 +2,7 @@ // Project: https://reactjs.org/ // Definitions by: Nathan Bierema // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 3.0 +// TypeScript Version: 2.8 export { default } from './ReactFiberReconciler'; diff --git a/types/react-reconciler/test/ReactTestRendererScheduling.ts b/types/react-reconciler/test/ReactTestRendererScheduling.ts index d1a91789ac..a080c01391 100644 --- a/types/react-reconciler/test/ReactTestRendererScheduling.ts +++ b/types/react-reconciler/test/ReactTestRendererScheduling.ts @@ -5,11 +5,11 @@ interface Deadline { // Current virtual time export let nowImplementation = () => 0; -export let scheduledCallback: ((deadline: Deadline) => unknown) | null = null; -export let yieldedValues: Array = []; +export let scheduledCallback: ((deadline: Deadline) => any) | null = null; +export let yieldedValues: Array = []; export function scheduleDeferredCallback( - callback: (deadline: Deadline) => unknown, + callback: (deadline: Deadline) => any, options?: { timeout: number }, ): number { scheduledCallback = callback; @@ -25,7 +25,7 @@ export function setNowImplementation(implementation: () => number): void { nowImplementation = implementation; } -export function flushAll(): Array { +export function flushAll(): Array { yieldedValues = []; while (scheduledCallback !== null) { const cb = scheduledCallback; @@ -44,7 +44,7 @@ export function flushAll(): Array { return yieldedValues; } -export function flushNumberOfYields(count: number): Array { +export function flushNumberOfYields(count: number): Array { let didStop = false; yieldedValues = []; while (scheduledCallback !== null && !didStop) { @@ -69,11 +69,11 @@ export function flushNumberOfYields(count: number): Array { return yieldedValues; } -export function yieldValue(value: unknown): void { +export function yieldValue(value: any): void { yieldedValues.push(value); } -export function clearYields(): Array { +export function clearYields(): Array { const values = yieldedValues; yieldedValues = []; return values;