Skip to content

Commit da57748

Browse files
ayushmanchhabrabrophdawg11remix-cla-bot[bot]
authored
fix(docs): add backticks to element names (#10874)
Co-authored-by: Matt Brophy <[email protected]> Co-authored-by: remix-cla-bot[bot] <92060565+remix-cla-bot[bot]@users.noreply.github.com> Co-authored-by: Ayushman Chhabra <[email protected]>
1 parent f8194fd commit da57748

File tree

9 files changed

+24
-23
lines changed

9 files changed

+24
-23
lines changed

contributors.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
- avipatel97
2626
- awreese
2727
- aymanemadidi
28+
- ayushmanchhabra
2829
- babafemij-k
2930
- bavardage
3031
- bbrowning918
@@ -112,8 +113,8 @@
112113
- johnpangalos
113114
- jonkoops
114115
- jrakotoharisoa
115-
- kachun333
116116
- juanpprieto
117+
- kachun333
117118
- kantuni
118119
- kark
119120
- KAROTT7

packages/react-router-dom-v5-compat/lib/components.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export interface StaticRouterProps {
6969
const ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
7070

7171
/**
72-
* A <Router> that may not navigate to any other location. This is useful
72+
* A `<Router>` that may not navigate to any other location. This is useful
7373
* on the server where there is no stateful UI.
7474
*/
7575
export function StaticRouter({

packages/react-router-dom/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ const isBrowser =
512512
const ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
513513

514514
/**
515-
* The public API for rendering a history-aware <a>.
515+
* The public API for rendering a history-aware `<a>`.
516516
*/
517517
export const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(
518518
function LinkWithRef(
@@ -623,7 +623,7 @@ export interface NavLinkProps
623623
}
624624

625625
/**
626-
* A <Link> wrapper that knows if it's "active" or not.
626+
* A `<Link>` wrapper that knows if it's "active" or not.
627627
*/
628628
export const NavLink = React.forwardRef<HTMLAnchorElement, NavLinkProps>(
629629
function NavLinkWithRef(

packages/react-router-dom/server.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export interface StaticRouterProps {
4343
}
4444

4545
/**
46-
* A <Router> that may not navigate to any other location. This is useful
46+
* A `<Router>` that may not navigate to any other location. This is useful
4747
* on the server where there is no stateful UI.
4848
*/
4949
export function StaticRouter({

packages/react-router-native/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export {
146146
export interface NativeRouterProps extends MemoryRouterProps {}
147147

148148
/**
149-
* A <Router> that runs on React Native.
149+
* A `<Router>` that runs on React Native.
150150
*/
151151
export function NativeRouter(props: NativeRouterProps) {
152152
return <MemoryRouter {...props} />;
@@ -162,7 +162,7 @@ export interface LinkProps extends TouchableHighlightProps {
162162
}
163163

164164
/**
165-
* A <TouchableHighlight> that navigates to a different URL when touched.
165+
* A `<TouchableHighlight>` that navigates to a different URL when touched.
166166
*/
167167
export function Link({
168168
onPress,

packages/react-router/lib/components.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export interface MemoryRouterProps {
184184
}
185185

186186
/**
187-
* A <Router> that stores all entries in memory.
187+
* A `<Router>` that stores all entries in memory.
188188
*
189189
* @see https://reactrouter.com/router-components/memory-router
190190
*/
@@ -368,9 +368,9 @@ export interface RouterProps {
368368
/**
369369
* Provides location context for the rest of the app.
370370
*
371-
* Note: You usually won't render a <Router> directly. Instead, you'll render a
372-
* router that is more specific to your environment such as a <BrowserRouter>
373-
* in web browsers or a <StaticRouter> for server rendering.
371+
* Note: You usually won't render a `<Router>` directly. Instead, you'll render a
372+
* router that is more specific to your environment such as a `<BrowserRouter>`
373+
* in web browsers or a `<StaticRouter>` for server rendering.
374374
*
375375
* @see https://reactrouter.com/router-components/router
376376
*/
@@ -451,7 +451,7 @@ export interface RoutesProps {
451451
}
452452

453453
/**
454-
* A container for a nested tree of <Route> elements that renders the branch
454+
* A container for a nested tree of `<Route>` elements that renders the branch
455455
* that best matches the current location.
456456
*
457457
* @see https://reactrouter.com/components/routes
@@ -593,7 +593,7 @@ class AwaitErrorBoundary extends React.Component<
593593

594594
/**
595595
* @private
596-
* Indirection to leverage useAsyncValue for a render-prop API on <Await>
596+
* Indirection to leverage useAsyncValue for a render-prop API on `<Await>`
597597
*/
598598
function ResolveAwait({
599599
children,

packages/react-router/lib/context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export interface NavigateOptions {
100100
* A Navigator is a "location changer"; it's how you get to different locations.
101101
*
102102
* Every history instance conforms to the Navigator interface, but the
103-
* distinction is useful primarily when it comes to the low-level <Router> API
103+
* distinction is useful primarily when it comes to the low-level `<Router>` API
104104
* where both the location and a navigator must be provided separately in order
105105
* to avoid "tearing" that may occur in a suspense-enabled app if the action
106106
* and/or location were to be read directly from the history instance.

packages/react-router/lib/hooks.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export function useHref(
8282
}
8383

8484
/**
85-
* Returns true if this component is a descendant of a <Router>.
85+
* Returns true if this component is a descendant of a `<Router>`.
8686
*
8787
* @see https://reactrouter.com/hooks/use-in-router-context
8888
*/
@@ -124,7 +124,7 @@ export function useNavigationType(): NavigationType {
124124
/**
125125
* Returns a PathMatch object if the given pattern matches the current URL.
126126
* This is useful for components that need to know "active" state, e.g.
127-
* <NavLink>.
127+
* `<NavLink>`.
128128
*
129129
* @see https://reactrouter.com/hooks/use-match
130130
*/
@@ -172,7 +172,7 @@ function useIsomorphicLayoutEffect(
172172
}
173173

174174
/**
175-
* Returns an imperative method for changing the location. Used by <Link>s, but
175+
* Returns an imperative method for changing the location. Used by `<Link>`s, but
176176
* may also be used by other elements to change the location.
177177
*
178178
* @see https://reactrouter.com/hooks/use-navigate
@@ -270,7 +270,7 @@ export function useOutletContext<Context = unknown>(): Context {
270270

271271
/**
272272
* Returns the element for the child route at this level of the route
273-
* hierarchy. Used internally by <Outlet> to render child routes.
273+
* hierarchy. Used internally by `<Outlet>` to render child routes.
274274
*
275275
* @see https://reactrouter.com/hooks/use-outlet
276276
*/
@@ -331,7 +331,7 @@ export function useResolvedPath(
331331
/**
332332
* Returns the element of the route that matched the current location, prepared
333333
* with the correct context to render the remainder of the route tree. Route
334-
* elements in the tree must render an <Outlet> to render their child route's
334+
* elements in the tree must render an `<Outlet>` to render their child route's
335335
* element.
336336
*
337337
* @see https://reactrouter.com/hooks/use-routes
@@ -903,15 +903,15 @@ export function useRouteError(): unknown {
903903
}
904904

905905
/**
906-
* Returns the happy-path data from the nearest ancestor <Await /> value
906+
* Returns the happy-path data from the nearest ancestor `<Await />` value
907907
*/
908908
export function useAsyncValue(): unknown {
909909
let value = React.useContext(AwaitContext);
910910
return value?._data;
911911
}
912912

913913
/**
914-
* Returns the error from the nearest ancestor <Await /> value
914+
* Returns the error from the nearest ancestor `<Await />` value
915915
*/
916916
export function useAsyncError(): unknown {
917917
let value = React.useContext(AwaitContext);

packages/router/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ type LowerCaseFormMethod = "get" | "post" | "put" | "patch" | "delete";
6868
type UpperCaseFormMethod = Uppercase<LowerCaseFormMethod>;
6969

7070
/**
71-
* Users can specify either lowercase or uppercase form methods on <Form>,
72-
* useSubmit(), <fetcher.Form>, etc.
71+
* Users can specify either lowercase or uppercase form methods on `<Form>`,
72+
* useSubmit(), `<fetcher.Form>`, etc.
7373
*/
7474
export type HTMLFormMethod = LowerCaseFormMethod | UpperCaseFormMethod;
7575

0 commit comments

Comments
 (0)