MDX Provider: how to? #2973
Replies: 2 comments 2 replies
-
I've found a way around this as follows: Firstly, I've had to patch
Once that's done I created a "pathless route" called import { Outlet } from "@remix-run/react";
import { MDXProvider } from "@mdx-js/react";
const components = {
Foo: ({children }) => {
return (
<div>
<marquee>{children}</marquee>
</div>
);
}
}
export default function Index() {
return(
<div className="prose max-w-none prose-a:text-pink-600 prose-li:marker:text-pink-600">
<MDXProvider components={components}>
<Outlet />
</MDXProvider>
</div>
)
} With this done, I can now put I'm honestly unclear if this has worked by design or by accident, but I can't complain. I've also not tested this widely, but it seems to work without problems. I'm not sure why |
Beta Was this translation helpful? Give feedback.
-
A quick update because this is where Google is directing me with this issue: You can set providerImportSource in the vite.config.js file instead of patching the package. Here is an example of how to do that:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to setup an MDX Provider that replaces tags globally?
The example below is using
mdx-js
. I don't know exactly howRemix
deals with MDX.Beta Was this translation helpful? Give feedback.
All reactions