scrimba
Learn React Router
Loaders & errors
Handling errors
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

AboutCommentsNotes
Handling errors
Expand for more info
Home.jsx
run
preview
console
import React from "react"
import { useLoaderData } from "react-router-dom"

export function loader() {
return "The data is here"
}

export default function HomePage() {
const data = useLoaderData()
console.log(data)
return (
<main>
<h1>Home page</h1>
</main>
);
}
Console
"The data is here"
,
/
-2:40