Skip to content

Commit bab0a97

Browse files
knewbury01asgerf
andauthored
Update javascript/ql/lib/semmle/javascript/frameworks/React.qll
Co-authored-by: Asger F <asgerf@github.com>
1 parent ae19736 commit bab0a97

File tree

1 file changed

+6
-4
lines changed
  • javascript/ql/lib/semmle/javascript/frameworks

1 file changed

+6
-4
lines changed

javascript/ql/lib/semmle/javascript/frameworks/React.qll

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -806,10 +806,12 @@ private class ReactRouterLocationSource extends DOM::LocationSource::Range {
806806

807807
private class UseRefDomValueSource extends DOM::DomValueSource::Range {
808808
UseRefDomValueSource() {
809-
exists(DataFlow::PropRead current, UseRefStep step | current = this |
810-
step.step(_, current) and
811-
current.mayHavePropertyName("current")
812-
)
809+
this =
810+
any(JsxAttribute attrib | attrib.getName() = "ref")
811+
.getValue()
812+
.flow()
813+
.getALocalSource()
814+
.getAPropertyRead("current")
813815
}
814816
}
815817

0 commit comments

Comments
 (0)