Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[legacy-framework] Fix <Link> not working correctly with i18n and basepath #2668

Merged
merged 2 commits into from
Aug 24, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nextjs/packages/next/client/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function linkClicked(
})
}

function Link(props: React.PropsWithChildren<LinkProps>) {
export function Link(props: React.PropsWithChildren<LinkProps>) {
if (process.env.NODE_ENV !== 'production') {
function createPropError(args: {
key: string
Expand Down
1 change: 1 addition & 0 deletions packages/babel-preset/src/rewrite-imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { BabelType } from 'babel-plugin-tester';
const defaultImportSource = '@blitzjs/core';

const specialImports: Record<string, string> = {
Link: 'next/link',
Image: 'next/image',
Script: 'next/script',

Expand Down
4 changes: 4 additions & 0 deletions packages/blitz/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ export * from "@blitzjs/core/server"
*/
export {default as Image} from "next/image"
export type {ImageProps, ImageLoader, ImageLoaderProps} from "next/image"

export * from "next/link"

export {Script} from "next/script"
export type {Props as ScriptProps} from "next/script"

export * from "next/stdlib"
export * from "next/stdlib-server"
export * from "next/data-client"
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export * from "./types"
export * from "./router"
export * from "./link"
export * from "./error"
export * from "./error-boundary"
export {withBlitzAppRoot} from "./blitz-app-root"
Expand Down
7 changes: 0 additions & 7 deletions packages/core/src/link.ts

This file was deleted.