Open JounQin opened 1 week ago
System: OS: macOS 15.1 CPU: (10) arm64 Apple M1 Max Memory: 5.05 GB / 64.00 GB Shell: 5.9 - /bin/zsh Browsers: Chrome: 130.0.6723.92 Safari: 18.1 npmPackages: @rspress/core: ^1.35.3 => 1.35.3
import Test from '../components/Test.mdx' <Test /> <Test color="red" />
<Test /> renders normally, <Test color="red" /> results:
<Test />
<Test color="red" />
Uncaught Error: Expected component `Test` to be defined: you likely forgot to import, pass, or provide it.
https://mdxjs.com/docs/using-mdx/#props
https://codesandbox.io/p/devbox/xenodochial-david-52cfy2?file=%2Fdocs%2Findex.mdx%3A5%2C21
npm i && npm dev
Currently, the processing of nested mdx is simple flatting, so this feature is not supported yet.
https://github.com/web-infra-dev/rspress/blob/main/packages/core/src/node/utils/flattenMdxContent.ts
Version
System: OS: macOS 15.1 CPU: (10) arm64 Apple M1 Max Memory: 5.05 GB / 64.00 GB Shell: 5.9 - /bin/zsh Browsers: Chrome: 130.0.6723.92 Safari: 18.1 npmPackages: @rspress/core: ^1.35.3 => 1.35.3
Details
<Test />
renders normally,<Test color="red" />
results:https://mdxjs.com/docs/using-mdx/#props
Reproduce link
https://codesandbox.io/p/devbox/xenodochial-david-52cfy2?file=%2Fdocs%2Findex.mdx%3A5%2C21
Reproduce Steps
npm i && npm dev