Skip to content

Commit e39f8a9

Browse files
docs(start/tutorial): small update (#10548)
1 parent 149ab96 commit e39f8a9

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- AmRo045
1515
- amsal
1616
- andreiduca
17+
- antonmontrezor
1718
- appden
1819
- arnassavickas
1920
- aroyan

docs/start/tutorial.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1487,8 +1487,17 @@ You could certainly do this as a controlled component, but you'll end up with mo
14871487

14881488
Notice how controlling the input requires three points of synchronization now instead of just one. The behavior is identical but the code is more complex.
14891489

1490-
```jsx filename=src/routes/root.jsx lines=[1,6,9-11,25-28]
1490+
```jsx filename=src/routes/root.jsx lines=[1,6,15,18-20,34-37]
14911491
import { useEffect, useState } from "react";
1492+
// existing code
1493+
1494+
export async function loader({ request }) {
1495+
const url = new URL(request.url);
1496+
const q = url.searchParams.get("q") || "";
1497+
const contacts = await getContacts(q);
1498+
return { contacts, q };
1499+
}
1500+
14921501
// existing code
14931502

14941503
export default function Root() {

0 commit comments

Comments
 (0)