useLoader

Returns the data of the the given loader. Only supports the loader from within the same file.

import { useLoader } from 'one'
export function loader() {
return { hello: 'world' }
}
export default function Page() {
const data = useLoader(loader)
return (
<>{data.hello}</>
)
}

Edit this page on GitHub.