Closed imclint21 closed 7 months ago
react-remark, rehype-react, react-markdown, and mdx all support custom instrinsic elements through extensions of the React intrinsic. You can find more on that here: https://goulet.dev/posts/consuming-web-component-react-typescript/
I see, but there no simple way to create custom components using remark without creating intrinsic components?
If you want strong TypeScript types, no. You need to type your custom elements.
Without TypeScript sure, as long as it's a valid HTML custom element it should work.
If you want custom elements in the JSX sense, then you would want/need https://mdxjs.com/
Initial checklist
Affected packages and versions
latest
Link to runnable example
No response
Steps to reproduce
Use
rehypeReactOptions
Expected behavior
I'm interested by create custom components like this:
Actual behavior
Seems than custom components does not work, and give an empty
Runtime
No response
Package manager
No response
OS
No response
Build and bundle tools
No response