[fix] react component runaways, error boundaries (#1625)

This PR fixes a few components that were updating too often. It changes
the format of our error boundaries in order to avoid re-rendering them
as changed props.

### Change Type

- [x] `major` — Breaking change
This commit is contained in:
Steve Ruiz 2023-06-20 15:06:28 +01:00 committed by GitHub
parent 5cb08711c1
commit 83184aaf43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 55 additions and 67 deletions

View file

@ -31,11 +31,7 @@ export const InnerIndicator = ({ editor, id }: { editor: Editor; id: TLShapeId }
if (!shape.shape) return null
return (
<OptionalErrorBoundary
fallback={
ShapeIndicatorErrorFallback
? (error) => <ShapeIndicatorErrorFallback error={error} />
: null
}
fallback={ShapeIndicatorErrorFallback}
onError={(error) =>
editor.annotateError(error, { origin: 'react.shapeIndicator', willCrashApp: false })
}