Skip to content

Commit 168215d

Browse files
committed
Add forked copies of reconciler modules
1 parent d7422d3 commit 168215d

40 files changed

Lines changed: 22668 additions & 10 deletions
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* Copyright (c) Facebook, Inc. and its affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @flow
8+
*/
9+
10+
import type {Fiber} from './ReactFiber.new';
11+
12+
import {getStackByFiberInDevAndProd} from './ReactFiberComponentStack';
13+
14+
export type CapturedValue<T> = {|
15+
value: T,
16+
source: Fiber | null,
17+
stack: string | null,
18+
|};
19+
20+
export function createCapturedValue<T>(
21+
value: T,
22+
source: Fiber,
23+
): CapturedValue<T> {
24+
// If the value is an error, call this function immediately after it is thrown
25+
// so the stack is accurate.
26+
return {
27+
value,
28+
source,
29+
stack: getStackByFiberInDevAndProd(source),
30+
};
31+
}

0 commit comments

Comments
 (0)