Skip to content

Commit 768ccc6

Browse files
committed
JS: Add test for react 'use' function
1 parent 93c891a commit 768ccc6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { use } from "react";
2+
3+
async function fetchData() {
4+
return new Promise((resolve) => {
5+
resolve(source("fetchedData"));
6+
});
7+
}
8+
9+
function Component() {
10+
const data = use(fetchData());
11+
sink(data); // $ MISSING: hasValueFlow=fetchedData
12+
}

0 commit comments

Comments
 (0)