We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent d260367 commit bb614f2Copy full SHA for bb614f2
packages/docs/src/templates/DocsLayout.tsx
@@ -61,16 +61,18 @@ const humanize = (text: string): string => {
61
62
const getDescription = (location: Location, description: string) => {
63
if (location.pathname.includes('api') || location.pathname.includes('styling')) {
64
- const regex = /React\s[A-Z][A-Za-z]*/
+ const regex = /React\s+(.*?)\s+component/
65
const parts = description.split(regex)
66
const matches = description.match(regex)
67
68
+ console.log('parts', parts)
69
+
70
if (matches && parts.length > 1) {
71
return (
72
<>
73
{parts[0]}
- <Link to="../">{matches[0]}</Link>
- {parts[1]}
74
+ <Link to="../">React {parts[1]}</Link> component
75
+ {parts[2]}
76
</>
77
)
78
}
0 commit comments