Skip to content

Commit

Permalink
Export Props interfaces to allow exported declarations
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nealeu committed Dec 31, 2019
1 parent 1351fd0 commit a8ea231
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions packages/react-async/src/Async.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ import {
ReducerAsyncState,
} from "./types"

interface InitialProps<T> {
export interface InitialProps<T> {
children?: InitialChildren<T>
persist?: boolean
}
interface PendingProps<T> {
export interface PendingProps<T> {
children?: PendingChildren<T>
initial?: boolean
}
interface FulfilledProps<T> {
export interface FulfilledProps<T> {
children?: FulfilledChildren<T>
persist?: boolean
}
interface RejectedProps<T> {
export interface RejectedProps<T> {
children?: RejectedChildren<T>
persist?: boolean
}
interface SettledProps<T> {
export interface SettledProps<T> {
children?: SettledChildren<T>
persist?: boolean
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-async/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Async from "./Async"
export { default as Async, createInstance } from "./Async"
export { default as Async, createInstance, AsyncConstructor, FulfilledProps, InitialProps, PendingProps, RejectedProps, SettledProps } from "./Async"
export * from "./types"
export { default as useAsync, useFetch, FetchOptions, FetchError } from "./useAsync"
export default Async
Expand Down

0 comments on commit a8ea231

Please sign in to comment.