Skip to content

Commit

Permalink
extsion check createCapturedValue also
Browse files Browse the repository at this point in the history
  • Loading branch information
gnoff committed Dec 3, 2022
1 parent 40d5bee commit d1d6184
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/react-reconciler/src/ReactCapturedValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ export function createCapturedValue<T>(
digest: ?string,
stack: ?string,
): CapturedValue<T> {
if (!hasOwnProperty.call(value, '_componentStack')) {
if (
Object.isExtensible((value: any)) &&
!hasOwnProperty.call(value, '_componentStack')
) {
(value: any)._componentStack = stack;
}
return {
Expand Down

0 comments on commit d1d6184

Please sign in to comment.