diff --git a/docs-ui/src/components/Changelog/utils.tsx b/docs-ui/src/components/Changelog/utils.tsx index f39aa7bba5..278072f37f 100644 --- a/docs-ui/src/components/Changelog/utils.tsx +++ b/docs-ui/src/components/Changelog/utils.tsx @@ -41,10 +41,20 @@ export const BreakingBadge = () => Breaking; // Utility Functions export const toTitleCase = (kebabCase: string): string => { + // Hook slugs (e.g. "use-table") display as camelCase (e.g. "useTable") + if (/^use-[A-Za-z]/.test(kebabCase)) { + const [first, ...rest] = kebabCase.split('-'); + return ( + first + + rest + .map(word => word.charAt(0).toLocaleUpperCase('en-US') + word.slice(1)) + .join('') + ); + } return kebabCase .split('-') .map(word => word.charAt(0).toLocaleUpperCase('en-US') + word.slice(1)) - .join(' '); + .join(''); }; export const groupByVersion = (