[x] I searched issues and couldn’t find anything (or linked relevant results below)
Subject
Adding a prop to the compile configuration called defaultComponents that does the same thing as the components prop does on individual mdx components but to every component.
Problem
I need the functionallity of the components prop on all mdx imports. I'm using solid-start and my pages are the mdx files. This makes a great development experience, but unfortunately I'm unable to pass props to the mdx components. A global defaultComponents configuration prop on the rollup plugin would fix that.
TODO
Solution
I figure it's pretty easy to add the defaultComponents prop to config and just use it in the compiled components as defaults right?
TODO
Alternatives
As far as in general, the alternative would be to make a components object stored in a separate file and import it into every place where you render any mdx components. (Or you could make a mdx component wrapper that renders a component with the props you need).
For me though I would have not use mdx as pages. So basically move them into a different folder and import them with dynamic routes.
Another way this could be solved is by providing an option in config for a component that renders the MDX Component. So in config
Initial checklist
Subject
Adding a prop to the
compile
configuration calleddefaultComponents
that does the same thing as thecomponents
prop does on individual mdx components but to every component.Problem
I need the functionallity of the
components
prop on all mdx imports. I'm usingsolid-start
and my pages are the mdx files. This makes a great development experience, but unfortunately I'm unable to pass props to the mdx components. A globaldefaultComponents
configuration prop on the rollup plugin would fix that.TODO
Solution
I figure it's pretty easy to add the
defaultComponents
prop to config and just use it in the compiled components as defaults right?TODO
Alternatives
As far as in general, the alternative would be to make a
components
object stored in a separate file and import it into every place where you render any mdx components. (Or you could make a mdx component wrapper that renders a component with the props you need).For me though I would have not use mdx as pages. So basically move them into a different folder and import them with dynamic routes.
Another way this could be solved is by providing an option in config for a component that renders the MDX Component. So in config
TODO