Skip to content

Commit fdabd5f

Browse files
chore: yarn format
1 parent 9988ee9 commit fdabd5f

6 files changed

Lines changed: 23 additions & 19 deletions

File tree

src/components/DataDimension/Info/ProgramIndicatorInfo.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,13 @@ export const ProgramIndicatorInfo = ({ type, id, displayNameProp }) => {
205205
<th>{i18n.t('Aggregation type')}</th>
206206
<td>{data?.programIndicator.aggregationType}</td>
207207
</tr>
208-
{data?.programIndicator && 'decimals' in data.programIndicator && (
209-
<tr>
210-
<th>{i18n.t('Decimals in output')}</th>
211-
<td>{data.programIndicator.decimals}</td>
212-
</tr>
213-
)}
208+
{data?.programIndicator &&
209+
'decimals' in data.programIndicator && (
210+
<tr>
211+
<th>{i18n.t('Decimals in output')}</th>
212+
<td>{data.programIndicator.decimals}</td>
213+
</tr>
214+
)}
214215
{Boolean(data?.programIndicator.legendSets.length) && (
215216
<tr>
216217
<th>{i18n.t('Legend set(s)')}</th>

src/components/FileMenu/DeleteDialog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const getMutation = (type) => ({
2323
})
2424

2525
export const DeleteDialog = ({ type, id, onClose, onDelete, onError }) => {
26-
const mutation = useMemo(() => getMutation(type), [])
26+
const mutation = useMemo(() => getMutation(type), [type])
2727
const [mutate] = useDataMutation(mutation, {
2828
variables: { id },
2929
onError: (error) => {

src/components/TranslationDialog/TranslationModal/TranslationForm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export const TranslationForm = ({
146146
fetchFieldsTranslations(fieldsToTranslate)
147147

148148
fetchTranslations()
149-
}, [fieldsToTranslate])
149+
}, [fieldsToTranslate, fetchFieldsTranslations])
150150

151151
useEffect(() => setNewTranslations(translations), [translations])
152152

src/components/UserMention/useUserSearchResults.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useDataQuery } from '@dhis2/app-runtime'
22
import debounce from 'lodash/debounce'
3-
import { useCallback, useEffect, useState } from 'react'
3+
import { useEffect, useMemo, useState } from 'react'
44

55
const usersQuery = {
66
users: {
@@ -21,7 +21,7 @@ export const useUserSearchResults = ({ searchText }) => {
2121
lazy: true,
2222
})
2323

24-
const debouncedRefetch = useCallback(debounce(refetch, 250), [refetch])
24+
const debouncedRefetch = useMemo(() => debounce(refetch, 250), [refetch])
2525

2626
useEffect(() => {
2727
if (searchText.length) {

src/modules/pivotTable/useScrollPosition.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
import debounce from 'lodash/debounce'
2-
import { useState, useCallback, useEffect } from 'react'
2+
import { useState, useMemo, useEffect } from 'react'
33

44
export const useScrollPosition = (containerRef, debounceWait = 10) => {
55
const [scrollPosition, setScrollPosition] = useState({ x: 0, y: 0 })
66

7-
const onScroll = useCallback(
8-
debounce(() => {
9-
const scroll = {
10-
x: containerRef.current.scrollLeft,
11-
y: containerRef.current.scrollTop,
12-
}
13-
setScrollPosition(scroll)
14-
}, debounceWait)
7+
const onScroll = useMemo(
8+
() =>
9+
debounce(() => {
10+
const scroll = {
11+
x: containerRef.current.scrollLeft,
12+
y: containerRef.current.scrollTop,
13+
}
14+
setScrollPosition(scroll)
15+
}, debounceWait),
16+
[containerRef, debounceWait]
1517
)
1618

1719
useEffect(() => {

src/modules/utils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const useDidUpdateEffect = (fn, inputs) => {
2222
} else {
2323
didMountRef.current = true
2424
}
25+
// eslint-disable-next-line react-hooks/exhaustive-deps
2526
}, inputs)
2627
}
2728

0 commit comments

Comments
 (0)