Skip to content

Commit

Permalink
Use create-react-context in @mdx-js/tag (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
mAAdhaTTah authored and johno committed Jul 23, 2018
1 parent 4ee2607 commit 633e71b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/tag/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"mdx"
],
"dependencies": {
"create-react-context": "^0.2.2",
"prop-types": "^15.6.1"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion packages/tag/src/mdx-provider.js
Original file line number Diff line number Diff line change
@@ -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 }) => (
<Consumer>
Expand Down
27 changes: 27 additions & 0 deletions packages/tag/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1261,6 +1261,13 @@ [email protected], 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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 633e71b

Please sign in to comment.