Skip to content

Commit 68a17fd

Browse files
authored
chore(docs): fix tutorial syntax line highlighting
looks like our prettier config changed
1 parent a2a60b0 commit 68a17fd

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

docs/getting-started/tutorial.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export default function Invoices() {
172172

173173
Finally, let's teach React Router how to render our app at different URLs by creating our first "Route Config" inside of `main.jsx`.
174174

175-
```tsx lines=[2,4-5,10-14] filename=src/main.jsx
175+
```tsx lines=[2,4-5,13-19] filename=src/main.jsx
176176
import { render } from "react-dom";
177177
import {
178178
BrowserRouter,
@@ -211,7 +211,7 @@ Let's get some automatic, persistent layout handling by doing just two things:
211211

212212
First let's nest the routes. Right now the expenses and invoices routes are siblings to to the app, we're want to make them _children_ of the app route:
213213

214-
```jsx lines=[11-14] filename=src/main.jsx
214+
```jsx lines=[15-18] filename=src/main.jsx
215215
import { render } from "react-dom";
216216
import {
217217
BrowserRouter,
@@ -243,7 +243,7 @@ When routes have children it does two things:
243243

244244
However, before (2) will work we need to render an `Outlet` in the `App.jsx` "parent" route.
245245

246-
```jsx lines=[1,11] filename=src/App.jsx
246+
```jsx lines=[1,16] filename=src/App.jsx
247247
import { Outlet, Link } from "react-router-dom";
248248

249249
export default function App() {
@@ -316,7 +316,7 @@ export function getInvoices() {
316316

317317
Now we can use it in the invoices route. Let's also add a bit of styling to get a sidebar nav layout going on. Feel free to copy/paste all of this, but take special note of the `<Link>` elements `to` prop:
318318

319-
```js lines=[12] filename=src/routes/invoices.jsx
319+
```js lines=[17] filename=src/routes/invoices.jsx
320320
import { Link } from "react-router-dom";
321321
import { getInvoices } from "../data";
322322

@@ -418,8 +418,8 @@ Alright, now go click a link to an invoice, note that the URL changes but the ne
418418
419419
That's right! We need to add an outlet to the parent layout route (we're really proud of you).
420420
421-
```tsx lines=[1,18] filename=src/routes/invoices.jsx
422-
import { Link } from "react-router-dom";
421+
```tsx lines=[1,24] filename=src/routes/invoices.jsx
422+
import { Link, Outlet } from "react-router-dom";
423423
import { getInvoices } from "../data";
424424
425425
export default function Invoices() {
@@ -467,7 +467,7 @@ Note that the key of the param on the `params` object is the same as the dynamic
467467
468468
Let's use that information to build up a more interesting invoice page. Open up `src/data.js` and add a new function to lookup invoices by their number:
469469

470-
```js filename=src/data.js lines=[7-9]
470+
```js filename=src/data.js lines=[7-11]
471471
// ...
472472
473473
export function getInvoices() {
@@ -552,7 +552,7 @@ Maybe you're still scratching your head. There are a few ways we try to answer t
552552
553553
It's very common, especially in navigation lists, to display the link as the active link the user is looking at. Let's add this treatment to our invoices list by swapping out `Link` for `NavLink`.
554554
555-
```jsx lines=[1,10-17,22] filename=src/routes/invoices.jsx
555+
```jsx lines=[1,15-27] filename=src/routes/invoices.jsx
556556
import { NavLink, Outlet } from "react-router-dom";
557557
import { getInvoices } from "../data";
558558

@@ -612,7 +612,7 @@ React Router makes it easy to read and manipulate the search params with `useSea
612612
613613
Let's see it in action by adding a little filter on the invoices nav list.
614614
615-
```jsx filename=routes/invoices.jsx lines=[1,6,11-20,22-27]
615+
```jsx filename=routes/invoices.jsx lines=[4,10,21-27,32-37]
616616
import {
617617
NavLink,
618618
Outlet,
@@ -761,7 +761,7 @@ function BrandLink({ brand, ...props }) {
761761
762762
Or maybe you want it to add the brand if it's not there already and remove it if it's clicked again!
763763
764-
```jsx [6-12]
764+
```jsx [7-12]
765765
function BrandLink({ brand, ...props }) {
766766
let [params] = useSearchParams();
767767
let isActive = params.getAll("brand").includes(brand);

0 commit comments

Comments
 (0)