{"name":"@mdx-js/react","version":"1.6.8","description":"React implementation for MDX","repository":{"type":"git","url":"git+https://github.com/mdx-js/mdx.git"},"homepage":"https://mdxjs.com","bugs":{"url":"https://github.com/mdx-js/mdx/issues"},"funding":{"type":"opencollective","url":"https://opencollective.com/unified"},"author":{"name":"John Otander","email":"johnotander@gmail.com","url":"http://johnotander.com"},"contributors":[{"name":"John Otander","email":"johnotander@gmail.com","url":"http://johnotander.com"},{"name":"Tim Neutkens","email":"tim@vercel.com"},{"name":"Matija Marohnić","email":"matija.marohnic@gmail.com"},{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},{"name":"JounQin","email":"admin@1stg.me","url":"https://www.1stg.me"}],"license":"MIT","main":"dist/cjs.js","module":"dist/esm.js","keywords":["mdx","markdown","react","jsx","remark","mdxast"],"peerDependencies":{"react":"^16.13.1"},"gitHead":"2771a52d912991d0d82ba6edfd618557073dc5f7","_id":"@mdx-js/react@1.6.8","_nodeVersion":"14.4.0","_npmVersion":"lerna/3.22.1/node@v14.4.0+x64 (darwin)","dist":{"integrity":"sha512-rCSfjF/NTyFgx2S4AbVV9utAHMOAIFDZEguuje5n6FLzH7o26sh9ylJ2kuKHEa10a0OFhcAnYg/CV9Ohqkia/g==","shasum":"ef528fb589d64f2e1f71771c034ecd7f07e2fc58","tarball":"http://registry-npm.ywwl.com/@mdx-js/react/download/@mdx-js/react-1.6.8.tgz","fileCount":5,"unpackedSize":15236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEKHZCRA9TVsSAnZWagAAJRgP/0SNQUd/k0d3aE2vXr6t\nM59bGwNUUYAywKsranTp+/WbhYGk6pBUSlR9+6qdfRCfFuCB44HHvrRCP+jv\nanJl4+/NtKanENm16iNaCc+/UOVawRII8WTOYfSxwhqwUwo5lhCxyZWNzaDX\nsaotyqgCzZnNmvgX3W2SULODFutP0SmLe91ttsFRORifycdL4COsSQpQrekw\nDB7Fml/344KxKxsDhfdi0BUM2C618bn8n6hzGFIIvd4EsemrU6dDAYnCncQO\nrCoan+DtkqqlrZXFJ+i9Bw4iAZnsA1AoCRu+LVdEuigizkrKN0FKrhMjxapX\nYIy4CYeA0alVF4oZPVfZB1q1Ia7sCPDLwHjJCTjuV42Tj0bPPozLm94gw6uS\neCD6raXBsFF2F+qeXUY/RuyBPfuxUtUSFyI3Q9GtUCXs0B2Rp0ZzPG9sFkKR\nWQLT2BuN1er4JlvVt4Okyw+R9fTt6ro0VKTQ55j7nLGZz7xzufMms0eyFSiw\nzRSLfr3b9MSN44fcumI4xnRonu1M75fiYa6wRnrMl2eUbqE+/Zxfw2xhc0jC\nI7HHUruYnVg9HZdrWA8rEpmtpNHm0G6Rqz3q7/iRKBThsXGGhGrWm4m8rHNy\ndxmpQm4KsHkEw+ZY1DSdjjeD8Mi/Mca4TlmgXce3nzZrXUQXqQBbBWSPGH0Y\nMgDM\r\n=sMwU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4oFXCDUJkimVfJUhcuUr6v3aYfN8Al3gfAGuy8A/k6gIgX7xE7SDfj7Ei9Zz6/vSmAEHa2Yvj5naX5PWEd6ZxOao="}],"size":3870,"noattachment":false,"key":"/@mdx-js/react/-/@mdx-js/react-1.6.8.tgz"},"maintainers":[{"email":"johnotander@gmail.com","name":"johno"},{"email":"matija.marohnic@gmail.com","name":"silvenon"},{"email":"tim@timneutkens.nl","name":"timneutkens"},{"email":"tituswormer@gmail.com","name":"wooorm"}],"_npmUser":{"name":"johno","email":"johnotander@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react_1.6.8_1594925528641_0.7717945511140738"},"_hasShrinkwrap":false,"readme":"# `@mdx-js/react`\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n[![Sponsors][sponsors-badge]][collective]\n[![Backers][backers-badge]][collective]\n[![Chat][chat-badge]][chat]\n\nReact context for MDX.\n\n<!-- more -->\n\n## Contents\n\n* [What is this?](#what-is-this)\n* [When should I use this?](#when-should-i-use-this)\n* [Install](#install)\n* [Use](#use)\n* [API](#api)\n  * [`MDXProvider(properties?)`](#mdxproviderproperties)\n  * [`useMDXComponents(components?)`](#usemdxcomponentscomponents)\n  * [`MergeComponents`](#mergecomponents)\n  * [`Props`](#props)\n* [Types](#types)\n* [Compatibility](#compatibility)\n* [Security](#security)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis package is a *context* based components provider for combining React with\nMDX.\n\n## When should I use this?\n\nThis package is **not needed** for MDX to work with React.\nSee [¶ MDX provider in § Using MDX][use-provider] for when and how to use an MDX\nprovider.\n\nIf you use Next.js, **do not use this**.\nAdd an `mdx-components.tsx` (in `src/` or `/`) file instead.\nSee [Configuring MDX on `nextjs.org`][next-configuring-mdx] for more info.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install @mdx-js/react\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```tsx\nimport {MDXProvider} from 'https://esm.sh/@mdx-js/react@3'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {MDXProvider} from 'https://esm.sh/@mdx-js/react@3?bundle'\n</script>\n```\n\n## Use\n\n```tsx\nimport {MDXProvider} from '@mdx-js/react'\nimport Post from './post.mdx'\n// ^-- Assumes an integration is used to compile MDX to JS, such as\n// `@mdx-js/esbuild`, `@mdx-js/loader`, `@mdx-js/node-loader`, or\n// `@mdx-js/rollup`, and that it is configured with\n// `options.providerImportSource: '@mdx-js/react'`.\n\n/** @type {import('mdx/types.js').MDXComponents} */\nconst components = {\n  em(properties) {\n    return <i {...properties} />\n  }\n}\n\nconsole.log(\n  <MDXProvider components={components}>\n    <Post />\n  </MDXProvider>\n)\n```\n\n> 👉 **Note**: you don’t have to use `MDXProvider` and can pass components\n> directly:\n>\n> ```diff\n> -<MDXProvider components={components}>\n> -  <Post />\n> -</MDXProvider>\n> +<Post components={components} />\n> ```\n\nSee [¶ React in § Getting started][start-react] for how to get started with MDX\nand React.\nSee [¶ MDX provider in § Using MDX][use-provider] for how to use an MDX\nprovider.\n\n## API\n\nThis package exports the identifiers [`MDXProvider`][api-mdx-provider] and\n[`useMDXComponents`][api-use-mdx-components].\nThere is no default export.\n\n### `MDXProvider(properties?)`\n\nProvider for MDX context.\n\n###### Parameters\n\n* `properties` ([`Props`][api-props])\n  — configuration\n\n##### Returns\n\nElement (`JSX.Element`).\n\n### `useMDXComponents(components?)`\n\nGet current components from the MDX Context.\n\n###### Parameters\n\n* `components` ([`MDXComponents` from `mdx/types.js`][mdx-types-components]\n  or [`MergeComponents`][api-merge-components], optional)\n  — additional components to use or a function that creates them\n\n###### Returns\n\nCurrent components ([`MDXComponents` from\n`mdx/types.js`][mdx-types-components]).\n\n### `MergeComponents`\n\nCustom merge function (TypeScript type).\n\n###### Parameters\n\n* `components` ([`MDXComponents` from `mdx/types.js`][mdx-types-components])\n  — current components from the context\n\n###### Returns\n\nAdditional components ([`MDXComponents` from\n`mdx/types.js`][mdx-types-components]).\n\n### `Props`\n\nConfiguration for `MDXProvider` (TypeScript type).\n\n###### Fields\n\n* `children` ([`ReactNode` from `react`][react-node],\n  optional)\n  — children\n* `components` ([`MDXComponents` from `mdx/types.js`][mdx-types-components]\n  or [`MergeComponents`][api-merge-components], optional)\n  — additional components to use or a function that creates them\n* `disableParentContext` (`boolean`, default: `false`)\n  — turn off outer component context\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional types [`MergeComponents`][api-merge-components] and\n[`Props`][api-props].\n\nFor types to work, make sure the TypeScript `JSX` namespace is typed.\nThis is done by installing and using the types of your framework, as in\n[`@types/react`](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react).\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line, `@mdx-js/react@^3`,\ncompatible with Node.js 16.\n\n## Security\n\nSee [§ Security][security] on our website for information.\n\n## Contribute\n\nSee [§ Contribute][contribute] on our website for ways to get started.\nSee [§ Support][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organization, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][] © Compositor and [Vercel][]\n\n[build-badge]: https://github.com/mdx-js/mdx/workflows/main/badge.svg\n\n[build]: https://github.com/mdx-js/mdx/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/mdx-js/mdx/main.svg\n\n[coverage]: https://codecov.io/github/mdx-js/mdx\n\n[downloads-badge]: https://img.shields.io/npm/dm/@mdx-js/react.svg\n\n[downloads]: https://www.npmjs.com/package/@mdx-js/react\n\n[size-badge]: https://img.shields.io/bundlejs/size/@mdx-js/react\n\n[size]: https://bundlejs.com/?q=@mdx-js/react\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[collective]: https://opencollective.com/unified\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/mdx-js/mdx/discussions\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[contribute]: https://mdxjs.com/community/contribute/\n\n[support]: https://mdxjs.com/community/support/\n\n[coc]: https://github.com/mdx-js/.github/blob/main/code-of-conduct.md\n\n[mit]: https://github.com/mdx-js/mdx/blob/main/packages/react/license\n\n[vercel]: https://vercel.com\n\n[start-react]: https://mdxjs.com/getting-started/#react\n\n[use-provider]: https://mdxjs.com/docs/using-mdx/#mdx-provider\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[security]: https://mdxjs.com/getting-started/#security\n\n[typescript]: https://www.typescriptlang.org\n\n[mdx-types-components]: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/HEAD/types/mdx/types.d.ts#L65\n\n[react-node]: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/HEAD/types/react/index.d.ts#L244\n\n[next-configuring-mdx]: https://nextjs.org/docs/pages/building-your-application/configuring/mdx\n\n[api-mdx-provider]: #mdxproviderproperties\n\n[api-merge-components]: #mergecomponents\n\n[api-props]: #props\n\n[api-use-mdx-components]: #usemdxcomponentscomponents\n","publish_time":1594925528796,"_cnpm_publish_time":1594925528796,"dist-tags":{"ci":"2.0.0-ci.53","latest":"3.1.1","next":"2.0.0-rc.2"}}