Skip to content

Commit e4819b6

Browse files
committed
Memoized capitalized
1 parent f45a343 commit e4819b6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

x-pack/legacy/plugins/siem/public/pages/case/components/configure_cases/field_mapping_row.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7-
import React from 'react';
7+
import React, { useMemo } from 'react';
88
import {
99
EuiFlexItem,
1010
EuiFlexGroup,
@@ -58,12 +58,13 @@ const FieldMappingRowComponent: React.FC<RowProps> = ({
5858
selectedActionType,
5959
selectedThirdParty,
6060
}) => {
61+
const siemFieldCapitalized = useMemo(() => capitalize(siemField), [siemField]);
6162
return (
6263
<EuiFlexGroup alignItems="center">
6364
<EuiFlexItem>
6465
<EuiFlexGroup component="span" justifyContent="spaceBetween">
6566
<EuiFlexItem component="span" grow={false}>
66-
{capitalize(siemField)}
67+
{siemFieldCapitalized}
6768
</EuiFlexItem>
6869
<EuiFlexItem component="span" grow={false}>
6970
<EuiIcon type="sortRight" />

0 commit comments

Comments
 (0)