|
1 | 1 | export * from '@sentry/node'; |
2 | 2 |
|
| 3 | +import type { Component, JSX } from 'solid-js'; |
| 4 | + |
3 | 5 | /** |
4 | 6 | * A passthrough error boundary for the server that doesn't depend on any react. Error boundaries don't catch SSR errors |
5 | 7 | * so they should simply be a passthrough. |
6 | 8 | */ |
7 | | -export const ErrorBoundary = (props: React.PropsWithChildren<unknown>): React.ReactNode => { |
| 9 | +export const ErrorBoundary = (props: { children?: JSX.Element | (() => JSX.Element) }): JSX.Element => { |
8 | 10 | if (!props.children) { |
9 | 11 | return null; |
10 | 12 | } |
11 | 13 |
|
12 | 14 | if (typeof props.children === 'function') { |
13 | | - return (props.children as () => React.ReactNode)(); |
| 15 | + return props.children(); |
14 | 16 | } |
15 | 17 |
|
16 | 18 | return props.children; |
17 | 19 | }; |
18 | 20 |
|
19 | 21 | /** |
20 | | - * A passthrough redux enhancer for the server that doesn't depend on anything from the `@sentry/react` package. |
| 22 | + * A passthrough store enhancer for the server that doesn't depend on anything from the `@sentry/react` package. |
21 | 23 | */ |
22 | | -export function createReduxEnhancer() { |
| 24 | +export function createStoreEnhancer() { |
23 | 25 | return (createStore: unknown) => createStore; |
24 | 26 | } |
25 | 27 |
|
26 | 28 | /** |
27 | 29 | * A passthrough error boundary wrapper for the server that doesn't depend on any react. Error boundaries don't catch |
28 | 30 | * SSR errors so they should simply be a passthrough. |
29 | 31 | */ |
30 | | -// eslint-disable-next-line @typescript-eslint/no-explicit-any |
31 | | -export function withErrorBoundary<P extends Record<string, any>>( |
32 | | - WrappedComponent: React.ComponentType<P>, |
33 | | -): React.FC<P> { |
34 | | - return WrappedComponent as React.FC<P>; |
| 32 | +export function withErrorBoundary<P extends Record<string, unknown>>( |
| 33 | + WrappedComponent: Component<P>, |
| 34 | +): Component<P> { |
| 35 | + return WrappedComponent; |
35 | 36 | } |
36 | 37 |
|
37 | 38 | /** |
|
0 commit comments