{"name":"@mdx-js/react","version":"1.5.9","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@zeit.co"},{"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.9.0"},"gitHead":"df5b5947282c7f48d0d95bbdf06a877350e0983b","_id":"@mdx-js/react@1.5.9","_nodeVersion":"12.10.0","_npmVersion":"lerna/3.20.2/node@v12.10.0+x64 (darwin)","dist":{"integrity":"sha512-rengdUSedIdIQbXPSeafItCacTYocARAjUA51b6R1KNHmz+59efz7UmyTKr73viJQZ98ouu7iRGmOTtjRrbbWA==","shasum":"31873ab097fbe58c61c7585fc0be64e83182b6df","tarball":"http://registry-npm.ywwl.com/@mdx-js/react/download/@mdx-js/react-1.5.9.tgz","fileCount":5,"unpackedSize":15157,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoI8vCRA9TVsSAnZWagAAaBUP/2KoxQNHFc7Xq23jvYmJ\nUhnY3mcgQ15/2Kkmv19+g7gKDv/qzeFYY5O2VGp2YnbuEfabxSAYQ3lJ1pD4\nPltEUTowoZNlmzdEUSdhsJQvU4bMUBsTdiODCVHwLfdSzVhK9nsdFaAT0Noa\nDlQiZbfbDGzj3lZnba18or1JFH5fgh6W3GIMDr25+tes7nfq0PlFK0izeEFD\n8durkSHODPbvagUl3LkIvbo+D4oLir4EN3NTeHR1PBcHB6nr94w2OksPymRX\npAl0MvoDpHtLsh6hGU232fnlos+kMhp70UloOehW6Ofv5BmxwdQG46CIsASB\noR8jXbmoOjbzdJ/ND4tiDrWNsV6nsKy5SdN94XhrNdO8HbTT35QnUmd1X9vf\nZFiRQ7N1fBrtAisk12tDV/orddcovl99w2VZ9Xrt/ZIh5gKWJLRUZWhnDa4U\neUrhu2hynESHtClqqLB2FHs8f2k7srA0bnhTyIsG19YipsofJQkQf3RJ29rQ\nEVT1WsSh1cp3NSPFS/a5Z0hTmqE+RgPMDOfAZ+Q7o9uQm48N3rSSkxzA7jjc\nNCHp5fzuOR6Gs511H6FV9HZNwc3hqZY37uFLwYORUaXxRQcqXMrfvErV/xxB\nKNioi9FcGSAX+23x2cK4UnwggVb80LVCxFkEmeh4ZbZFpDh0jcBa2xr4PVJQ\nxuzr\r\n=l7kf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICARrsq0GtESyLEsRNWOdHmqLkJMdzC4fYDBhYDFJxZ2AiEAxnm+0o9bqE02ZLZBzhhE3hwTXrK0IMF+1US2yyiEJoU="}],"size":3917,"noattachment":false,"key":"/@mdx-js/react/-/@mdx-js/react-1.5.9.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.5.9_1587580718497_0.20127644347398221"},"_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":1587580718650,"_cnpm_publish_time":1587580718650,"dist-tags":{"ci":"2.0.0-ci.53","latest":"3.1.1","next":"2.0.0-rc.2"}}