Skip to content

support errorInfo in onRecoverableError#24591

Merged
gnoff merged 9 commits intofacebook:mainfrom
gnoff:on-recoverable-error
Jun 6, 2022
Merged

support errorInfo in onRecoverableError#24591
gnoff merged 9 commits intofacebook:mainfrom
gnoff:on-recoverable-error

Conversation

@gnoff
Copy link
Copy Markdown
Collaborator

@gnoff gnoff commented May 20, 2022

errorInfo has been used in Error Boundaries wiht componentDidCatch for a while now. To date this metadata only contained a componentStack. onRecoverableError only receives an error (type mixed) argument and thus providing additional error metadata was not possible without mutating user created mixed objects.

This change modifies rootConcurrentErrors rootRecoverableErrors, and hydrationErrors so all expect CapturedValue types. additionally a new factory function allows the creation of CapturedValues from a value plus a hash and stack.

In general, client derived CapturedValues will be created using the original function which derives a componentStack from a fiber and server originated CapturedValues will be created using with a passed in hash and optional componentStack.

This PR builds on #24551 and once that is merged I will rebase this PR to clean up the diff

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants