From 774330981b49cb7fe0b7f6f659e14b187018a43c Mon Sep 17 00:00:00 2001 From: James DiGioia Date: Fri, 6 Jul 2018 10:39:03 -0400 Subject: [PATCH] Use create-react-context in @mdx-js/tag (#179) --- packages/tag/package.json | 1 + packages/tag/src/mdx-provider.js | 3 ++- packages/tag/yarn.lock | 27 +++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/packages/tag/package.json b/packages/tag/package.json index 00c077fb9..e5300d77b 100644 --- a/packages/tag/package.json +++ b/packages/tag/package.json @@ -21,6 +21,7 @@ "mdx" ], "dependencies": { + "create-react-context": "^0.2.2", "prop-types": "^15.6.1" }, "devDependencies": { diff --git a/packages/tag/src/mdx-provider.js b/packages/tag/src/mdx-provider.js index 1e51ccd67..5ab2ed412 100644 --- a/packages/tag/src/mdx-provider.js +++ b/packages/tag/src/mdx-provider.js @@ -1,7 +1,8 @@ import React from 'react' +import createReactContext from 'create-react-context' import PropTypes from 'prop-types' -const { Provider, Consumer } = React.createContext({}) +const { Provider, Consumer } = createReactContext({}) export const withMDXComponents = Component => ({ components, ...props }) => ( diff --git a/packages/tag/yarn.lock b/packages/tag/yarn.lock index 580e12627..a0900eb6b 100644 --- a/packages/tag/yarn.lock +++ b/packages/tag/yarn.lock @@ -1261,6 +1261,13 @@ core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" +create-react-context@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/create-react-context/-/create-react-context-0.2.2.tgz#9836542f9aaa22868cd7d4a6f82667df38019dca" + dependencies: + fbjs "^0.8.0" + gud "^1.0.0" + cross-spawn@^5.0.1: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" @@ -1581,6 +1588,18 @@ fb-watchman@^2.0.0: dependencies: bser "^2.0.0" +fbjs@^0.8.0: + version "0.8.17" + resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd" + dependencies: + core-js "^1.0.0" + isomorphic-fetch "^2.1.1" + loose-envify "^1.0.0" + object-assign "^4.1.0" + promise "^7.1.1" + setimmediate "^1.0.5" + ua-parser-js "^0.7.18" + fbjs@^0.8.16: version "0.8.16" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db" @@ -1792,6 +1811,10 @@ growly@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" +gud@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/gud/-/gud-1.0.0.tgz#a489581b17e6a70beca9abe3ae57de7a499852c0" + handlebars@^4.0.3: version "4.0.11" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc" @@ -3960,6 +3983,10 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" +ua-parser-js@^0.7.18: + version "0.7.18" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.18.tgz#a7bfd92f56edfb117083b69e31d2aa8882d4b1ed" + ua-parser-js@^0.7.9: version "0.7.17" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac"