Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add forked copies of reconciler modules
- Loading branch information
Showing
39 changed files
with
22,666 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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), | ||
}; | ||
} |
Oops, something went wrong.