IndexableDisplayName() — react Function Reference
Architecture documentation for the IndexableDisplayName() function in IndexableDisplayName.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD 1742c432_ccc4_7c2d_78cd_dc0ea7fa0a0e["IndexableDisplayName()"] e7454a5e_e77e_ba9f_94e6_70ddbe468ec8["IndexableDisplayName.js"] 1742c432_ccc4_7c2d_78cd_dc0ea7fa0a0e -->|defined in| e7454a5e_e77e_ba9f_94e6_70ddbe468ec8 4f6eddf7_d50d_ae38_f866_1ed43601207e["createRegExp()"] 1742c432_ccc4_7c2d_78cd_dc0ea7fa0a0e -->|calls| 4f6eddf7_d50d_ae38_f866_1ed43601207e style 1742c432_ccc4_7c2d_78cd_dc0ea7fa0a0e fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/react-devtools-shared/src/devtools/views/Components/IndexableDisplayName.js lines 24–61
function IndexableDisplayName({displayName, id}: Props): React.Node {
const {searchIndex, searchResults, searchText} = useContext(TreeStateContext);
const isSearchResult = useMemo(() => {
return searchResults.includes(id);
}, [id, searchResults]);
const isCurrentResult =
searchIndex !== null && id === searchResults[searchIndex];
if (!isSearchResult || displayName === null) {
return displayName;
}
const match = createRegExp(searchText).exec(displayName);
if (match === null) {
return displayName;
}
const startIndex = match.index;
const stopIndex = startIndex + match[0].length;
const children = [];
if (startIndex > 0) {
children.push(<span key="begin">{displayName.slice(0, startIndex)}</span>);
}
children.push(
<mark
key="middle"
className={isCurrentResult ? styles.CurrentHighlight : styles.Highlight}>
{displayName.slice(startIndex, stopIndex)}
</mark>,
);
if (stopIndex < displayName.length) {
children.push(<span key="end">{displayName.slice(stopIndex)}</span>);
}
return children;
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does IndexableDisplayName() do?
IndexableDisplayName() is a function in the react codebase, defined in packages/react-devtools-shared/src/devtools/views/Components/IndexableDisplayName.js.
Where is IndexableDisplayName() defined?
IndexableDisplayName() is defined in packages/react-devtools-shared/src/devtools/views/Components/IndexableDisplayName.js at line 24.
What does IndexableDisplayName() call?
IndexableDisplayName() calls 1 function(s): createRegExp.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free