diff --git a/packages/docz-theme-default/package.json b/packages/docz-theme-default/package.json index b915bd59b..7e4fb34d2 100644 --- a/packages/docz-theme-default/package.json +++ b/packages/docz-theme-default/package.json @@ -28,11 +28,11 @@ "fuse.js": "^3.2.1", "prismjs": "^1.15.0", "prop-types": "15.6.2", - "react": "^16.4.1", + "react": "^16.2.0", "react-adopt": "^0.6.0", "react-breakpoints": "^3.0.0", "react-content-loader": "^3.1.2", - "react-dom": "^16.4.1", + "react-dom": "^16.2.0", "react-emotion": "^9.2.4", "react-feather": "^1.1.0", "react-lightweight-tooltip": "^1.0.0", @@ -40,10 +40,12 @@ "webfontloader": "^1.6.28" }, "peerDependencies": { - "react": "^16.3.0", - "react-dom": "^16.3.0" + "react": "^16.2.0", + "react-dom": "^16.2.0" }, "devDependencies": { + "@types/react": "^16.3.0", + "@types/react-dom": "^16.0.6", "@types/prismjs": "^1.9.0", "babel-plugin-emotion": "^9.2.4", "rollup-plugin-svg": "^1.0.1" diff --git a/packages/docz/package.json b/packages/docz/package.json index 20aa45c60..ec1e32481 100644 --- a/packages/docz/package.json +++ b/packages/docz/package.json @@ -26,26 +26,27 @@ "dependencies": { "@mdx-js/tag": "^0.11.0", "@sindresorhus/slugify": "^0.3.0", + "create-react-context": "^0.2.2", "deepmerge": "^2.1.1", "docz-core": "^0.5.1", "docz-theme-default": "^0.5.1", "invariant": "^2.2.4", "loadable-components": "^2.2.2", "pascalcase": "^0.1.1", - "react": "^16.4.1", - "react-dom": "^16.4.1", + "react": "^16.2.0", + "react-dom": "^16.2.0", "react-router-dom": "^4.3.1", "react-router-hash-link": "^1.2.0", "yargs": "^12.0.1" }, "peerDependencies": { - "react": "^16.3.0", - "react-dom": "^16.3.0" + "react": "^16.2.0", + "react-dom": "^16.2.0" }, "devDependencies": { "@types/bluebird": "^3.5.21", "@types/deepmerge": "^2.1.0", - "@types/react": "^16.4.6", + "@types/react": "^16.3.0", "@types/react-dom": "^16.0.6", "@types/react-router-dom": "^4.2.7" } diff --git a/packages/docz/src/theme.tsx b/packages/docz/src/theme.tsx index f5b017657..b91fd87fb 100644 --- a/packages/docz/src/theme.tsx +++ b/packages/docz/src/theme.tsx @@ -2,6 +2,7 @@ import * as React from 'react' import { Fragment, SFC } from 'react' import { ComponentType as CT } from 'react' import { HashRouter, BrowserRouter } from 'react-router-dom' +import createReactContext from 'create-react-context' import merge from 'deepmerge' import { ErrorBoundary } from './components/ErrorBoundary' @@ -54,7 +55,7 @@ const initialContext: DataContext = { imports: {}, } -export const dataContext = React.createContext(initialContext) +export const dataContext = createReactContext(initialContext) const DefaultWrapper: SFC = ({ children }) => {children} diff --git a/yarn.lock b/yarn.lock index 0cd2d334b..81bf96197 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1340,11 +1340,9 @@ dependencies: csstype "^2.2.0" -"@types/react@^16.4.6": - version "16.4.6" - resolved "https://registry.npmjs.org/@types/react/-/react-16.4.6.tgz#5024957c6bcef4f02823accf5974faba2e54fada" - dependencies: - csstype "^2.2.0" +"@types/react@^16.3.0": + version "16.3.0" + resolved "https://registry.npmjs.org/@types/react/-/react-16.3.0.tgz#46e24f7178efe953b564030345f0284121afd79a" "@types/relateurl@*": version "0.2.28" @@ -3878,6 +3876,13 @@ create-react-context@0.2.1: fbjs "^0.8.0" gud "^1.0.0" +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-env@^5.1.6: version "5.1.6" resolved "https://registry.npmjs.org/cross-env/-/cross-env-5.1.6.tgz#0dc05caf945b24e4b9e3b12871fe0e858d08b38d" @@ -9289,7 +9294,7 @@ react-docgen@^3.0.0-beta12: node-dir "^0.1.10" recast "^0.12.6" -react-dom@^16.4.1: +react-dom@^16.2.0, react-dom@^16.4.1: version "16.4.1" resolved "https://registry.npmjs.org/react-dom/-/react-dom-16.4.1.tgz#7f8b0223b3a5fbe205116c56deb85de32685dad6" dependencies: @@ -9365,7 +9370,7 @@ react-router@^4.3.1: prop-types "^15.6.1" warning "^4.0.1" -react@^16.3.2, react@^16.4.1: +react@^16.2.0, react@^16.3.2, react@^16.4.1: version "16.4.1" resolved "https://registry.npmjs.org/react/-/react-16.4.1.tgz#de51ba5764b5dbcd1f9079037b862bd26b82fe32" dependencies: