Skip to content

Commit e3e0e5c

Browse files
committed
fix: tag jump fail
1 parent ebb0d03 commit e3e0e5c

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

packages/crd-scripts/src/web/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { hydrateRoot } from 'react-dom/client'
21
import { renderToString } from 'react-dom/server';
2+
import { hydrateRoot } from 'react-dom/client'
33
import '@babel/polyfill'
44
import { ifDev, ifPrerender } from 'crd-client-utils'
55
import RouterRoot from './Router'
@@ -20,4 +20,4 @@ if (ifDev) {
2020
document.getElementById('root'),
2121
<RouterRoot />,
2222
)
23-
}
23+
}

packages/crd-seed/component/Tags/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import { Link, useRouteMatch } from 'react-router-dom'
22
import { ifProd } from 'crd-client-utils'
3+
import { ifAddPrefix } from '../../utils'
34
import styles from './index.less'
45

56
/**
67
* name: the name of tag category.
78
*/
89
const Tags = () => {
910
const { user, repo } = DOCSCONFIG || {}
10-
const routeMatch = useRouteMatch('/tags/:name') || {}
11+
const path = ifAddPrefix ? `/${repo}/tags/:name` : '/tags/:name'
12+
const routeMatch = useRouteMatch(path) || {}
1113
const { name } = routeMatch.params || {}
1214

1315
return (

packages/crd-theme/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ export default function (props) {
1414
// support for custom theme.
1515
const CustomTheme = require('__project_theme__').default
1616

17+
// use custom theme here.
1718
return (
18-
<React.StrictMode>
19-
{/* use custom theme here. */}
20-
<CustomTheme {...props} />
21-
</React.StrictMode>
19+
<CustomTheme {...props} />
2220
)
2321
}

0 commit comments

Comments
 (0)