Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change extension of 'src/routes/invoice.js' to 'jsx' #8536

Merged
merged 1 commit into from Dec 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/getting-started/tutorial.md
Expand Up @@ -376,9 +376,9 @@ The `"*"` has special meaning here. It will match only when no other routes do.

## Reading URL Params

Alright, back to the individual invoice URLs. Let's add a route for a specific invoice. We just visited some URLs like `"/invoices/1998"` and `"/invoices/2005"`, let's make a new component at `src/routes/invoice.js` to render at those URLs:
Alright, back to the individual invoice URLs. Let's add a route for a specific invoice. We just visited some URLs like `"/invoices/1998"` and `"/invoices/2005"`, let's make a new component at `src/routes/invoice.jsx` to render at those URLs:

```js filename=src/routes/invoice.js
```js filename=src/routes/invoice.jsx
export default function Invoice() {
return <h2>Invoice #???</h2>;
}
Expand Down Expand Up @@ -450,7 +450,7 @@ export default function Invoices() {

Okay, let's close the circle here. Open up the invoice component again and let's get the `:invoiceId` param from the URL:

```ts lines=[1,4] filename=src/routes/invoice.js
```ts lines=[1,4] filename=src/routes/invoice.jsx
import { useParams } from "react-router-dom";

export default function Invoice() {
Expand Down Expand Up @@ -481,9 +481,9 @@ export function getInvoice(number) {
}
```

And now back in `invoice.js` we use the param to look up an invoice and display more information:
And now back in `invoice.jsx` we use the param to look up an invoice and display more information:

```js filename=routes/invoice.js lines=[2,6]
```js filename=routes/invoice.jsx lines=[2,6]
import { useParams } from "react-router-dom";
import { getInvoice } from "../data";

Expand Down