Skip to content

Commit 5baa3e0

Browse files
golopotljharb
authored andcommitted
[Perf] component detection: improve performance by optimizing getId
1 parent d0da6bf commit 5baa3e0

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
1313

1414
### Changed
1515
* [Docs] [`no-unknown-property`]: fix typo in link ([#3445][] @denkristoffer)
16+
* [Perf] component detection: improve performance by optimizing getId ([#3451][] @golopot)
1617

18+
[#3451]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3451
1719
[#3448]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3448
1820
[#3445]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3445
1921
[#3436]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3436

lib/util/Components.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const isFirstLetterCapitalized = require('./isFirstLetterCapitalized');
2121
const isDestructuredFromPragmaImport = require('./isDestructuredFromPragmaImport');
2222

2323
function getId(node) {
24-
return node && node.range.join(':');
24+
return node ? `${node.range[0]}:${node.range[1]}` : '';
2525
}
2626

2727
function usedPropTypesAreEquivalent(propA, propB) {

0 commit comments

Comments
 (0)