Skip to content

Commit

Permalink
feat(react): update useErrorBoundary from experimental to stable
Browse files Browse the repository at this point in the history
  • Loading branch information
manudeli committed Oct 23, 2023
1 parent b5864d5 commit 402161c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/src/pages/docs/react/ErrorBoundary.en.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const Example = (

## useErrorBoundary

<Callout type="warning">useErrorBoundary is experimental feature, this interfaces could be changed</Callout>
### useErrorBoundary().setError

In children of `<ErrorBoundary/>`, we can use useErrorBoundary().setError to make `<ErrorBoundary/>` aware of the Error without throw.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/docs/react/ErrorBoundary.ko.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const Example = (

## useErrorBoundary

<Callout type="warning">useErrorBoundary는 실험 기능이므로 이 인터페이스는 변경될 수 있습니다.</Callout>
### useErrorBoundary().setError

`<ErrorBoundary/>`의 children에서 useErrorBoundary().setError을 사용해 throw 없이도 `<ErrorBoundary/>`에서 Error를 알도록 할 수 있습니다.

Expand Down
3 changes: 0 additions & 3 deletions packages/react/src/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ export const withErrorBoundary = <TProps extends ComponentProps<ComponentType> =

const ErrorBoundaryContext = createContext<({ reset: () => void } & ErrorBoundaryState) | null>(null)

/**
* @experimental This is experimental feature.
*/
export const useErrorBoundary = <TError extends Error = Error>() => {
const [state, setState] = useState<ErrorBoundaryState<TError>>({
isError: false,
Expand Down

0 comments on commit 402161c

Please sign in to comment.