mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
JS: Propagate React components through recompose HOCs
This commit is contained in:
@@ -88,7 +88,7 @@ module FunctionCompositionCall {
|
||||
RightToLeft() {
|
||||
this = DataFlow::moduleImport(["compose-function"]).getACall()
|
||||
or
|
||||
this = DataFlow::moduleMember(["redux", "ramda", "@reduxjs/toolkit"], "compose").getACall()
|
||||
this = DataFlow::moduleMember(["redux", "ramda", "@reduxjs/toolkit", "recompose"], "compose").getACall()
|
||||
or
|
||||
this = LodashUnderscore::member("flowRight").getACall()
|
||||
}
|
||||
|
||||
@@ -777,6 +777,8 @@ private DataFlow::SourceNode higherOrderComponentBuilder() {
|
||||
or
|
||||
result = DataFlow::moduleMember("redux-form", "reduxForm").getACall()
|
||||
or
|
||||
result = DataFlow::moduleMember("recompose", _).getACall()
|
||||
or
|
||||
result = reactRouterDom().getAPropertyRead("withRouter")
|
||||
or
|
||||
exists(FunctionCompositionCall compose |
|
||||
|
||||
@@ -4,6 +4,7 @@ import { compose } from 'redux';
|
||||
import styled from 'styled-components';
|
||||
import unknownFunction from 'somewhere';
|
||||
import { hot } from 'react-hot-loader';
|
||||
import { withState } from 'recompose';
|
||||
|
||||
import { MyComponent } from './exportedComponent';
|
||||
|
||||
@@ -22,4 +23,6 @@ const withConnect = connect(mapStateToProps, mapDispatchToProps);
|
||||
|
||||
const ConnectedComponent = compose(withConnect, unknownFunction)(StyledComponent);
|
||||
|
||||
export default hot(module)(memo(ConnectedComponent));
|
||||
const ConnectedComponent2 = withState('counter', 'setCounter', 0)(ConnectedComponent);
|
||||
|
||||
export default hot(module)(memo(ConnectedComponent2));
|
||||
|
||||
Reference in New Issue
Block a user