@ui5/webcomponents-react
Version:
React Wrapper for UI5 Web Components and additional components
11 lines • 467 B
JavaScript
import { isValidElement } from 'react';
import { safeGetChildrenArray } from '../../internal/safeGetChildrenArray.js';
export const getSectionById = (sections, id) => {
return safeGetChildrenArray(sections).find(objectPageSection => {
return /*#__PURE__*/isValidElement(objectPageSection) && objectPageSection.props?.id === id;
});
};
export const extractSectionIdFromHtmlId = id => {
if (!id) return null;
return id.replace(/^ObjectPageSection-/, '');
};