Closed lannonbr closed 5 years ago
Thanks for opening an issue and creating a repro!
When I swap wrapRootElement
with wrapPageElement
it works. I suspect this has to do with gatsby-plugin-theme-ui
overriding at the root level as well so the component isn't being rendered (since Theme UI will also create an h1 and add to context).
At the very least this doesn't seem to be a bug in MDX core since the provider appears to be working as expected. This seems to be a bug in Gatsby and/or Theme UI because I'd expect the user's gatsby-browser to wrap after a plugin's 🤔.
Going to go ahead and close this for now since it isn't MDX core specific and an issue in Gatsby or Theme UI.
Subject of the issue
So as of the latest version, the MDXProvider component is not applying components that are passed into it through the
components
prop.Your environment
Steps to reproduce
Repro: https://github.com/lannonbr/MDXProvider-bug-repro
The repo is a fresh
gatsby new
of the blog theme starter. Then I added agatsby-browser.js
to add the component as such:Expected behaviour
Should switch all
<h1>
tags to<h4>
with red textActual behaviour
Absolutely nothing. the provider doesn't seem to applying the new components.