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

Fix type of children prop for react provider #1762

Merged
merged 1 commit into from
Oct 20, 2021
Merged

Fix type of children prop for react provider #1762

merged 1 commit into from
Oct 20, 2021

Conversation

remcohaszing
Copy link
Member

Currently the <MDXProvider /> component expects at least 2 children, but it’s also acceptable to use just one child.

playground link

Currently the `<MDXProvider />` component expects at least 2 children, but it’s
also acceptable to use just one child.
@vercel
Copy link

vercel bot commented Oct 20, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/mdx/mdx/CqKZ7nrC9MRVHb8YQAy2EhqCYgPc
✅ Preview: https://mdx-git-fork-remcohaszing-fix-react-provider-children-mdx.vercel.app

@vercel vercel bot temporarily deployed to Preview October 20, 2021 07:55 Inactive
Copy link
Member

@wooorm wooorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about preact?

@wooorm
Copy link
Member

wooorm commented Oct 20, 2021

I guess it’s fine:

* @property {ComponentChildren} [children]

@codecov-commenter

This comment has been minimized.

@remcohaszing
Copy link
Member Author

Yes, I checked preact too. Those types are fine.

Also, playground link

@wooorm wooorm merged commit 8a3eb15 into mdx-js:main Oct 20, 2021
@wooorm
Copy link
Member

wooorm commented Oct 20, 2021

the last playground link included react for me btw, and the earlier one said that React was not defined. Seems some of the TS playground config you have isn’t coming through!

@remcohaszing
Copy link
Member Author

Both work for me, also in Chrome guest mode.

The second playground imports preact as React, because this is needed for JSX syntax using default configurations.

@wooorm
Copy link
Member

wooorm commented Oct 20, 2021

ah, maybe that was it. Checked in Chrome and that does seem to work!

@ChristianMurphy ChristianMurphy added the ☂️ area/types This affects typings label Oct 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☂️ area/types This affects typings
Development

Successfully merging this pull request may close these issues.

4 participants