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

v2 clarifications #1943

Closed
4 tasks done
y-nk opened this issue Feb 19, 2022 · 1 comment
Closed
4 tasks done

v2 clarifications #1943

y-nk opened this issue Feb 19, 2022 · 1 comment
Labels
🙋 no/question This does not need any changes 👎 phase/no Post cannot or will not be acted on

Comments

@y-nk
Copy link

y-nk commented Feb 19, 2022

Initial checklist

Affected packages and versions

mdx-js/react@2

Link to runnable example

No response

Steps to reproduce

  1. According to MDX v2: ☂️ Umbrella issue #1041, the MDXProvider is expecting a prop named mdxComponents instead of components, but the doc seems to point out the opposite. Which one is it?

  2. According to Don't replace literal HTML elements with MDXProvider #821, the property named disableParentContext should act as a sandbox whenever possible, but i've been trying to see the difference and it seems not working so well.

→ With CRA: https://codesandbox.io/s/pedantic-germain-gqoij3?file=/src/App.js
→ With NextJS: https://codesandbox.io/s/damp-dawn-odt97x?file=/pages/_app.js

Expected behavior

<MDXProvider components={components}>{children}</MDXProvider> should work as intended.

Actual behavior

Not following the docs/specs.

Runtime

Other (please specify in steps to reproduce)

Package manager

yarn v1, Other (please specify in steps to reproduce)

OS

macOS

Build and bundle tools

Next.js

@wooorm
Copy link
Member

wooorm commented Feb 19, 2022

Hey!

Please use discussions for questions. But in most cases, the current docs will be correct instead of some comments in (old, long) issues.

If you’re migrating, see the migration notes. You’re likely not setting a providerImportSource: https://mdxjs.com/migrating/v2/#mdx-jsloader.
You also might not need the provider, though Next.js kinda makes it needed. See https://mdxjs.com/docs/using-mdx/.

@wooorm wooorm closed this as completed Feb 19, 2022
@wooorm wooorm added 👎 phase/no Post cannot or will not be acted on 🙋 no/question This does not need any changes labels Feb 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙋 no/question This does not need any changes 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

2 participants