File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,9 +6,21 @@ type SuccessFunction<Data> = (data: Data) => ReactNode
66type ErrorFunction < Error > = ( error : NonNullable < Error > ) => ReactNode
77
88type Props < Data , Error > = {
9- data ?: Data
10- error ?: Error
11- isLoading ?: boolean
9+ /**
10+ * The async data to show.
11+ * Note that `error` and `isLoading` take precedence over data.
12+ */
13+ data : Data | undefined
14+ /**
15+ * Set an error to show the error state.
16+ * Note that `isLoading` takes precedence over error.
17+ */
18+ error : Error | undefined
19+ /**
20+ * Set to a boolean value to explicitly control loading state.
21+ * If undefined, loading state is shown when there is no data (null | undefined) and no error (null | undefined).
22+ */
23+ isLoading : boolean | undefined
1224 renderLoading ?: ReactNode | LoadingFunction
1325 renderError ?: ReactNode | ErrorFunction < Error >
1426} & (
You can’t perform that action at this time.
0 commit comments