Browse Source

[Beta] Misc fixes

main
Dan Abramov 2 years ago
parent
commit
18a4fc0220
  1. 2
      beta/src/components/Layout/Sidebar/SidebarRouteTree.tsx
  2. 2
      beta/src/components/Layout/useRouteMeta.tsx
  3. 2
      beta/src/components/Seo.tsx
  4. 2
      beta/src/content/learn/index.md

2
beta/src/components/Layout/Sidebar/SidebarRouteTree.tsx

@ -77,7 +77,7 @@ export function SidebarRouteTree({
level = 0,
}: SidebarRouteTreeProps) {
const {breadcrumbs} = useRouteMeta(routeTree);
const cleanedPath = useRouter().asPath.split('?')[0];
const cleanedPath = useRouter().asPath.split(/[\?\#]/)[0];
const pendingRoute = usePendingRoute();
const slug = cleanedPath;

2
beta/src/components/Layout/useRouteMeta.tsx

@ -62,7 +62,7 @@ export function useRouteMeta(rootRoute?: RouteItem) {
breadcrumbs: [],
};
}
const cleanedPath = router.asPath.split('?')[0];
const cleanedPath = router.asPath.split(/[\?\#]/)[0];
const breadcrumbs = getBreadcrumbs(cleanedPath, routeTree);
return {
...getRouteMeta(cleanedPath, routeTree),

2
beta/src/components/Seo.tsx

@ -39,7 +39,7 @@ export const Seo = withRouter(
<meta
property="og:url"
key="og:url"
content={`https://beta.reactjs.org${router.asPath.split('?')[0]}`}
content={`https://beta.reactjs.org${router.asPath.split(/[\?\#]/)[0]}`}
/>
{title != null && (
<meta property="og:title" content={title} key="og:title" />

2
beta/src/content/learn/index.md

@ -304,7 +304,7 @@ Often, you'll want your component to "remember" some information and display it.
First, import [`useState`](/apis/react/useState) from React:
```js {1,4}
```js
import { useState } from 'react';
```

Loading…
Cancel
Save