SR
Click to open github profile
Functions

getCraftLocation

Learn how to use the getCraftLocation function.


You can use this function to get the current location of the request. Typically it should be used in the app.tsx where you define your CraftProvider.

app.tsx
import { seLocation } from 'react-router'

export function App() {
  const location = getCraftLocation(useLocation())
  return (
    <CraftProvider location={location}>
      <div></div>
    </CraftProvider>
  )
}

Types

export function getCraftLocation(location: Location): {
    pathname: string;
    absoluteUrl: string;
}

Copyright © 2025 Samuel Reichör