Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gatsby-plugin-mdx: MDXRender accepts components - but no functionality #21682

Closed
ohlr opened this issue Feb 22, 2020 · 4 comments · Fixed by #24271
Closed

gatsby-plugin-mdx: MDXRender accepts components - but no functionality #21682

ohlr opened this issue Feb 22, 2020 · 4 comments · Fixed by #24271
Assignees
Labels
type: documentation An issue or pull request for improving or updating Gatsby's documentation

Comments

@ohlr
Copy link

ohlr commented Feb 22, 2020

Description

https://www.gatsbyjs.org/packages/gatsby-plugin-mdx/#mdxprovider
accepts components to allow modification

MDXRerender also accepts components but it does not do anything with them.

Steps to reproduce

    <MDXRenderer
      components={{
        a: MdxLink,
      }}
    >
      {mdx.code.body}
    </MDXRenderer>

This neither changes the a tag to MdxLink nor throws an error.
This should not be the case at least in typescript

Expected result

What should happen?
Either remove the components property or add the the functionality of MDXProvider to MDXRenderer.

Environment

System:
OS: Linux 5.3 Ubuntu 18.04.4 LTS (Bionic Beaver)
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Shell: 4.4.20 - /bin/bash
Binaries:
Node: 10.19.0 - /usr/bin/node
Yarn: 1.21.1 - ~/.yarn/bin/yarn
npm: 6.13.4 - /usr/bin/npm
Languages:
Python: 3.7.3 - /home/user/anaconda3/bin/python
Browsers:
Chrome: 80.0.3987.106
Firefox: 73.0
npmPackages:
gatsby: ^2.15.24 => 2.15.24
gatsby-plugin-layout: ^1.1.22 => 1.1.22
gatsby-plugin-mdx: ^1.0.73 => 1.0.73
gatsby-plugin-react-helmet: ^3.1.8 => 3.1.8
gatsby-plugin-typescript: ^2.1.9 => 2.1.9
gatsby-source-filesystem: ^2.1.46 => 2.1.46
gatsby-transformer-json: ^2.2.26 => 2.2.26
npmGlobalPackages:
gatsby-cli: 2.8.27

@ohlr ohlr changed the title Typescript: MDXRender accepts components - no functionality gatsby-plugin-mdx: MDXRender accepts components - but no functionality Feb 22, 2020
@johno
Copy link
Contributor

johno commented Feb 25, 2020

Thanks for opening this issue! We should remove the components prop from MDXRenderer because it's not actually being used and that functionality can be achieved using the MDXProvider.

We won't need to make it a breaking change to remove the prop because it was never being passed on properly in the first place.

@LekoArts LekoArts added the type: documentation An issue or pull request for improving or updating Gatsby's documentation label Mar 16, 2020
@LekoArts
Copy link
Contributor

@johno @gatsbyjs/learning This will also need some documentation work.

@Arthur092
Copy link

Hi guys, so are we removing the component property from documentation?
I am a new contributor, I'd like to do it if you don't mind :)
Let me know so I can create the PR

@floAr
Copy link
Contributor

floAr commented May 20, 2020

I took it up as the issue was getting rather quiet. Quick question: Would it also be preferred to directly convert to typescript?

@LekoArts LekoArts assigned laurieontech and unassigned johno Sep 9, 2020
laurieontech pushed a commit that referenced this issue Sep 9, 2020
* Remove 'components' from MDXRenderer signature

Work for #21682

* Removed 'components' from MDXRenderer type

* removed components

* removed unneeded extra imports
pragmaticpat pushed a commit to pragmaticpat/gatsby that referenced this issue Apr 28, 2022
…yjs#24271)

* Remove 'components' from MDXRenderer signature

Work for gatsbyjs#21682

* Removed 'components' from MDXRenderer type

* removed components

* removed unneeded extra imports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation An issue or pull request for improving or updating Gatsby's documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants