Skip to content

Commit a8ea231

Browse files
committed
Export Props interfaces to allow exported declarations
Otherwise we get: TS4023: Exported variable 'MyAsync' has or is using name 'PendingProps' from external module "<snip>/node_modules/react-async/dist-types/index" but cannot be named.
1 parent 1351fd0 commit a8ea231

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/react-async/src/Async.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,23 @@ import {
2222
ReducerAsyncState,
2323
} from "./types"
2424

25-
interface InitialProps<T> {
25+
export interface InitialProps<T> {
2626
children?: InitialChildren<T>
2727
persist?: boolean
2828
}
29-
interface PendingProps<T> {
29+
export interface PendingProps<T> {
3030
children?: PendingChildren<T>
3131
initial?: boolean
3232
}
33-
interface FulfilledProps<T> {
33+
export interface FulfilledProps<T> {
3434
children?: FulfilledChildren<T>
3535
persist?: boolean
3636
}
37-
interface RejectedProps<T> {
37+
export interface RejectedProps<T> {
3838
children?: RejectedChildren<T>
3939
persist?: boolean
4040
}
41-
interface SettledProps<T> {
41+
export interface SettledProps<T> {
4242
children?: SettledChildren<T>
4343
persist?: boolean
4444
}

packages/react-async/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Async from "./Async"
2-
export { default as Async, createInstance } from "./Async"
2+
export { default as Async, createInstance, AsyncConstructor, FulfilledProps, InitialProps, PendingProps, RejectedProps, SettledProps } from "./Async"
33
export * from "./types"
44
export { default as useAsync, useFetch, FetchOptions, FetchError } from "./useAsync"
55
export default Async

0 commit comments

Comments
 (0)