mirror of
https://github.com/github/codeql.git
synced 2026-04-24 16:25:15 +02:00
JS: Add test for react 'use' function
This commit is contained in:
12
javascript/ql/test/library-tests/TripleDot/react-use.js
vendored
Normal file
12
javascript/ql/test/library-tests/TripleDot/react-use.js
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { use } from "react";
|
||||
|
||||
async function fetchData() {
|
||||
return new Promise((resolve) => {
|
||||
resolve(source("fetchedData"));
|
||||
});
|
||||
}
|
||||
|
||||
function Component() {
|
||||
const data = use(fetchData());
|
||||
sink(data); // $ MISSING: hasValueFlow=fetchedData
|
||||
}
|
||||
Reference in New Issue
Block a user