Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

converted FatalErrorBoundary to typescript #1273

Merged
merged 5 commits into from
Oct 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
class InfallibleErrorBoundary extends React.Component {
type PropsInfallibleErrorBoundary = Partial<{
children: React.ReactNode
}>

type State = {
hasError: boolean
}

class InfallibleErrorBoundary extends React.Component<
PropsInfallibleErrorBoundary,
State
> {
state = { hasError: false }

static getDerivedStateFromError() {
Expand All @@ -14,7 +25,15 @@ class InfallibleErrorBoundary extends React.Component {
}
}

class FatalErrorBoundary extends React.Component {
type PropsFatalErrorBoundary = {
children?: React.ReactNode
page: React.ComponentType
shzmr marked this conversation as resolved.
Show resolved Hide resolved
}

class FatalErrorBoundary extends React.Component<
PropsFatalErrorBoundary,
State
> {
state = { hasError: false }

static getDerivedStateFromError() {
Expand Down
1 change: 0 additions & 1 deletion packages/web/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export { useQuery } from '@apollo/client/react/hooks/useQuery'
export { useMutation } from '@apollo/client/react/hooks/useMutation'
export { useApolloClient } from '@apollo/client/react/hooks/useApolloClient'

// @ts-expect-error - no defs
export { default as FatalErrorBoundary } from 'src/components/FatalErrorBoundary'
// @ts-expect-error - no defs
export { default as RedwoodProvider } from 'src/components/RedwoodProvider'
Expand Down