Skip to content

Commit

Permalink
refactor(react): clarify variable name (#156)
Browse files Browse the repository at this point in the history
* refactor(react): clarify variable name

* Create chilly-drinks-change.md
  • Loading branch information
manudeli authored Sep 22, 2023
1 parent 0c04cb1 commit da0bd52
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilly-drinks-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@suspensive/react": patch
---

refactor(react): clarify variable name
10 changes: 5 additions & 5 deletions packages/react/src/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,16 @@ class BaseErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState
* This component provide a simple and reusable wrapper that you can use to wrap around your components. Any rendering errors in your components hierarchy can then be gracefully handled.
* @see {@link https://suspensive.org/docs/react/src/ErrorBoundary.i18n Suspensive Official Docs}
*/
export const ErrorBoundary = forwardRef<{ reset(): void }, ErrorBoundaryProps>((props, resetRef) => {
export const ErrorBoundary = forwardRef<{ reset(): void }, ErrorBoundaryProps>((props, ref) => {
const group = useContext(ErrorBoundaryGroupContext) ?? { resetKey: 0 }
const resetKeys = [group.resetKey, ...(props.resetKeys || [])]

const ref = useRef<BaseErrorBoundary>(null)
useImperativeHandle(resetRef, () => ({
reset: () => ref.current?.reset(),
const baseErrorBoundaryRef = useRef<BaseErrorBoundary>(null)
useImperativeHandle(ref, () => ({
reset: () => baseErrorBoundaryRef.current?.reset(),
}))

return <BaseErrorBoundary {...props} resetKeys={resetKeys} ref={ref} />
return <BaseErrorBoundary {...props} resetKeys={resetKeys} ref={baseErrorBoundaryRef} />
})
if (process.env.NODE_ENV !== 'production') {
ErrorBoundary.displayName = 'ErrorBoundary'
Expand Down

1 comment on commit da0bd52

@vercel
Copy link

@vercel vercel bot commented on da0bd52 Sep 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

visualization – ./websites/visualization

visualization-suspensive.vercel.app
visualization-git-main-suspensive.vercel.app
visualization.suspensive.org

Please sign in to comment.