react-dom-polyfill
Advanced tools
Comparing version 1.0.0-beta.2 to 1.0.0-beta.4
@@ -9,2 +9,3 @@ 'use strict'; | ||
try { | ||
// eslint-disable-next-line global-require, import/no-extraneous-dependencies | ||
return require('react-dom'); | ||
@@ -11,0 +12,0 @@ } catch (e) { |
{ | ||
"name": "react-dom-polyfill", | ||
"version": "1.0.0-beta.2", | ||
"version": "1.0.0-beta.4", | ||
"description": "Publish React libs that work with all React versions (0.12+)", | ||
@@ -11,5 +11,2 @@ "repository": "https://github.com/skidding/react-cosmos/tree/master/packages/react-dom-polyfill", | ||
}, | ||
"optionalDependencies": { | ||
"react-dom": "<16" | ||
}, | ||
"browserify": { | ||
@@ -16,0 +13,0 @@ "transform": "browserify-optional" |
@@ -21,3 +21,3 @@ # React DOM Polyfill | ||
Notes: | ||
- Also update your React/ReactDOM peer dependencies to make your published lib compatible with all React versions. The latter should be optional. This is a rough example: | ||
- Also update your React/ReactDOM peer dependencies to make your published lib compatible with all React versions. The latter should be missing (and thus optional). This is a rough example: | ||
@@ -27,5 +27,2 @@ ```json | ||
"react": ">=0.12 <16" | ||
}, | ||
"optionalDependencies": { | ||
"react-dom": "<16" | ||
} | ||
@@ -32,0 +29,0 @@ ``` |
@@ -7,4 +7,5 @@ module.exports = (React) => { | ||
try { | ||
// eslint-disable-next-line global-require, import/no-extraneous-dependencies | ||
return require('react-dom'); | ||
} catch(e) { | ||
} catch (e) { | ||
return null; | ||
@@ -16,3 +17,3 @@ } | ||
findDOMNode: (reactElement) => ( | ||
typeof(reactElement.getDOMNode) === 'function' ? | ||
typeof reactElement.getDOMNode === 'function' ? | ||
reactElement.getDOMNode() : reactElement | ||
@@ -22,4 +23,4 @@ ), | ||
unmountComponentAtNode, | ||
} | ||
}; | ||
} | ||
}; |
@@ -12,3 +12,3 @@ const reactDOMPolyfillInjector = require('inject?react-dom!../src'); | ||
render: sinon.spy(), | ||
unmountComponentAtNode: sinon.spy() | ||
unmountComponentAtNode: sinon.spy(), | ||
}; | ||
@@ -21,3 +21,3 @@ | ||
ReactDOM = reactDOMPolyfill(ReactMock); | ||
}) | ||
}); | ||
@@ -24,0 +24,0 @@ it(`${version} should render using React DOM`, () => { |
@@ -16,3 +16,3 @@ const reactDOMPolyfill = require('../src'); | ||
ReactDOM = reactDOMPolyfill(ReactMock); | ||
}) | ||
}); | ||
@@ -38,3 +38,3 @@ it(`${version} should render using React`, () => { | ||
const element = { | ||
getDOMNode: sinon.stub().returns(domElement) | ||
getDOMNode: sinon.stub().returns(domElement), | ||
}; | ||
@@ -41,0 +41,0 @@ |
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
6118
1
7
121
37
1