Skip to content

Commit

Permalink
Add forked copies of reconciler modules
Browse files Browse the repository at this point in the history
  • Loading branch information
acdlite committed Apr 9, 2020
1 parent d7422d3 commit 413081f
Show file tree
Hide file tree
Showing 39 changed files with 22,666 additions and 6 deletions.
31 changes: 31 additions & 0 deletions packages/react-reconciler/src/ReactCapturedValue.new.js
@@ -0,0 +1,31 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/

import type {Fiber} from './ReactFiber.new';

import {getStackByFiberInDevAndProd} from './ReactFiberComponentStack';

export type CapturedValue<T> = {|
value: T,
source: Fiber | null,
stack: string | null,
|};

export function createCapturedValue<T>(
value: T,
source: Fiber,
): CapturedValue<T> {
// If the value is an error, call this function immediately after it is thrown
// so the stack is accurate.
return {
value,
source,
stack: getStackByFiberInDevAndProd(source),
};
}

0 comments on commit 413081f

Please sign in to comment.