Skip to content

Commit

Permalink
React19: Fix build by extracting const in a separate file
Browse files Browse the repository at this point in the history
The build did not like that we imported the useMapParam file inside the middleware even though we only picked the mapParamFallback const from it. Moving the const to a separate file resolved the issue.
  • Loading branch information
tordans committed Jul 1, 2024
1 parent 2a3c6e8 commit c987637
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { mapParamFallback } from '../../useMapParam'
import { mapParamFallback } from '../../utils/mapParamFallback.const'
import { serializeMapParam } from '../../utils/mapParam'
import { UrlMigration } from './types'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { createParser, useQueryState } from 'nuqs'
import { useStaticRegion } from 'src/app/regionen/[regionSlug]/_components/regionUtils/useStaticRegion'
import { parseMapParam, serializeMapParam } from './utils/mapParam'
import { searchParamsRegistry } from './searchParamsRegistry'

export const mapParamFallback = { lat: 52.5, lng: 13.4, zoom: 12.1 }
import { mapParamFallback } from './utils/mapParamFallback.const'

export const useMapParam = () => {
const region = useStaticRegion()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const mapParamFallback = { lat: 52.5, lng: 13.4, zoom: 12.1 }

0 comments on commit c987637

Please sign in to comment.