We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7d069bb commit 34e79eeCopy full SHA for 34e79ee
examples/with-typescript/src/App.tsx
@@ -1,8 +1,11 @@
1
import React, { Component } from "react"
2
-import Async from "react-async"
+import Async, { createInstance } from "react-async"
3
import DevTools from "react-async-devtools"
4
import "./App.css"
5
6
+const promiseFn = () => Promise.resolve("baz")
7
+const CustomAsync = createInstance({ promiseFn })
8
+
9
class App extends Component {
10
render() {
11
return (
@@ -13,6 +16,9 @@ class App extends Component {
13
16
<Async promiseFn={() => Promise.resolve("bar")}>
14
17
<Async.Resolved>{data => <>{data}</>}</Async.Resolved>
15
18
</Async>
19
+ <CustomAsync>
20
+ <CustomAsync.Resolved>{data => <>{data}</>}</CustomAsync.Resolved>
21
+ </CustomAsync>
22
</header>
23
</div>
24
)
0 commit comments