Skip to content

Commit 2f5d954

Browse files
authoredDec 9, 2024
fix unable override injected img component (#3785)
1 parent 5444afe commit 2f5d954

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed
 

‎.changeset/real-fishes-double.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'nextra': patch
3+
---
4+
5+
fix unable override injected `img` component

‎packages/nextra/src/client/mdx.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ const DEFAULT_COMPONENTS = {
1313
} satisfies MDXComponents
1414

1515
export const useMDXComponents: typeof originalUseMDXComponents = components => {
16-
return originalUseMDXComponents({
16+
return {
1717
...DEFAULT_COMPONENTS,
18-
...components
19-
})
18+
...originalUseMDXComponents(components)
19+
}
2020
}
2121

2222
export { MDXProvider } from '@mdx-js/react'

0 commit comments

Comments
 (0)