From 01bf9dc9e9301e09c894907030ade897154862f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Ma=C5=82kowski?= Date: Fri, 29 Nov 2019 16:44:17 +0700 Subject: [PATCH] fix(error-boundary-jsx): fix broken dupe exports (#284) * fix(error-boundary-jsx): fix broken dupe exports * fix: tests * fix: another test --- packages/error-boundary-jsx/src/ErrorBoundary/index.tsx | 3 +-- packages/error-boundary-jsx/src/index.ts | 5 ++++- packages/error-boundary-jsx/tests/ErrorBoundary.test.tsx | 3 ++- packages/error-boundary-jsx/tests/withErrorBoundary.test.tsx | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/error-boundary-jsx/src/ErrorBoundary/index.tsx b/packages/error-boundary-jsx/src/ErrorBoundary/index.tsx index f32b1486..388e219f 100644 --- a/packages/error-boundary-jsx/src/ErrorBoundary/index.tsx +++ b/packages/error-boundary-jsx/src/ErrorBoundary/index.tsx @@ -1,4 +1,3 @@ -import ErrorBoundary, { ErrorFallbackProps } from './ErrorBoundary'; +import ErrorBoundary from './ErrorBoundary'; export default ErrorBoundary; -export type ErrorFallbackProps = ErrorFallbackProps; diff --git a/packages/error-boundary-jsx/src/index.ts b/packages/error-boundary-jsx/src/index.ts index e82dbc7e..2d2127b8 100644 --- a/packages/error-boundary-jsx/src/index.ts +++ b/packages/error-boundary-jsx/src/index.ts @@ -1,3 +1,6 @@ +import { ErrorFallbackProps } from './ErrorBoundary/ErrorBoundary'; + export { default as withErrorBoundary } from './withErrorBoundary'; export { default as ErrorBoundary } from './ErrorBoundary'; -export * from './ErrorBoundary'; + +export type ErrorFallbackProps = ErrorFallbackProps; diff --git a/packages/error-boundary-jsx/tests/ErrorBoundary.test.tsx b/packages/error-boundary-jsx/tests/ErrorBoundary.test.tsx index beb8d382..a49cb92e 100644 --- a/packages/error-boundary-jsx/tests/ErrorBoundary.test.tsx +++ b/packages/error-boundary-jsx/tests/ErrorBoundary.test.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import { render, cleanup } from '@testing-library/react'; -import ErrorBoundary, { ErrorFallbackProps } from '../src/ErrorBoundary'; +import ErrorBoundary from '../src/ErrorBoundary'; +import { ErrorFallbackProps } from '../src/ErrorBoundary/ErrorBoundary'; describe('', () => { class BuggyComponent extends React.PureComponent<{}, {}> { diff --git a/packages/error-boundary-jsx/tests/withErrorBoundary.test.tsx b/packages/error-boundary-jsx/tests/withErrorBoundary.test.tsx index 3df08d4a..bc7d594f 100644 --- a/packages/error-boundary-jsx/tests/withErrorBoundary.test.tsx +++ b/packages/error-boundary-jsx/tests/withErrorBoundary.test.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { cleanup, render } from '@testing-library/react'; import withErrorBoundary from '../src/withErrorBoundary'; -import { ErrorFallbackProps } from '../src/ErrorBoundary'; +import { ErrorFallbackProps } from '../src/ErrorBoundary/ErrorBoundary'; interface DummyErrorComponentProps { name?: string;