Runtime API
The Halite global is available in every .hal component.
Halite.props
Type: Record<string, any>
The props passed to this component.
Halite.params
Type: Record<string, string | undefined>
The dynamic segments of the current route.
Halite.redirect()
Type: (path: string, status?: 301 | 302 | 307 | 308) => Response
Redirects to another page.
---
if (!Halite.cookies.has('session')) {
return Halite.redirect('/login');
}
---Updated
Was this page helpful?