Skip to content

Commit 3ee16f8

Browse files
Pull out props to separate variables instead of referencing props.foo
1 parent e379320 commit 3ee16f8

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

extensions/ql-vscode/src/view/model-editor/HiddenMethodsRow.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,19 @@ interface Props {
1414
someMethodsAreVisible: boolean;
1515
}
1616

17-
export function HiddenMethodsRow(props: Props) {
18-
if (props.numHiddenMethods === 0) {
17+
export function HiddenMethodsRow({
18+
numHiddenMethods,
19+
someMethodsAreVisible,
20+
}: Props) {
21+
if (numHiddenMethods === 0) {
1922
return null;
2023
}
2124

2225
return (
2326
<VSCodeDataGridRow>
2427
<HiddenMethodsCell gridColumn="span 5">
25-
{props.someMethodsAreVisible && "And "}
26-
{props.numHiddenMethods} methods modeled in other CodeQL packs
28+
{someMethodsAreVisible && "And "}
29+
{numHiddenMethods} methods modeled in other CodeQL packs
2730
</HiddenMethodsCell>
2831
</VSCodeDataGridRow>
2932
);

extensions/ql-vscode/src/view/model-editor/MethodRow.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ type Props = {
7171
};
7272

7373
export const MethodRow = (props: Props) => {
74-
if (props.methodCanBeModeled) {
74+
const { methodCanBeModeled } = props;
75+
76+
if (methodCanBeModeled) {
7577
return <ModelableMethodRow {...props} />;
7678
} else {
7779
return <UnmodelableMethodRow {...props} />;

0 commit comments

Comments
 (0)