react-merge-refs
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -5,3 +5,3 @@ # Changelog | ||
## 1.0.0 (2019-09-19) | ||
## [1.1.0](https://github.com/gregberge/react-merge-refs/compare/v1.0.0...v1.1.0) (2020-07-27) | ||
@@ -11,2 +11,8 @@ | ||
* first version ([f8d7132](https://github.com/smooth-code/react-merge-refs/commit/f8d7132)) | ||
* add typescript mappings ([53480d2](https://github.com/gregberge/react-merge-refs/commit/53480d2a383e7f5f316f86418f1a3f5b1ee6166b)) | ||
## 1.0.0 (2019-09-19) | ||
### Features | ||
- first version ([f8d7132](https://github.com/gregberge/react-merge-refs/commit/f8d7132)) |
@@ -1,2 +0,8 @@ | ||
module.exports=function(n){return function(o){n.forEach(function(n){"function"==typeof n?n(o):null!=n&&(n.current=o)})}}; | ||
//# sourceMappingURL=index.js.map | ||
'use strict' | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./react-merge-refs.cjs.production.min.js') | ||
} else { | ||
module.exports = require('./react-merge-refs.cjs.development.js') | ||
} |
@@ -9,30 +9,34 @@ { | ||
], | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"author": "Greg Bergé <berge.greg@gmail.com>", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"umd:main": "dist/index.umd.js", | ||
"module": "dist/index.mjs", | ||
"source": "src/index.js", | ||
"module": "dist/react-merge-refs.esm.js", | ||
"typings": "dist/index.d.ts", | ||
"repository": "github:gregberge/react-merge-refs", | ||
"funding": { | ||
"type": "github", | ||
"url": "https://github.com/sponsors/gregberge" | ||
}, | ||
"scripts": { | ||
"test": "jest", | ||
"prebuild": "rm -rf dist/", | ||
"build": "microbundle --external react", | ||
"prepublishOnly": "yarn build", | ||
"release": "standard-version && conventional-github-releaser --preset angular" | ||
"release": "standard-version && conventional-github-releaser --preset angular", | ||
"start": "tsdx watch", | ||
"test": "tsdx test", | ||
"build": "tsdx build" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.6.0", | ||
"@babel/preset-env": "^7.6.0", | ||
"@babel/preset-react": "^7.0.0", | ||
"@testing-library/react": "^9.1.4", | ||
"babel-core": "^7.0.0-0", | ||
"babel-jest": "^24.9.0", | ||
"@testing-library/react": "^10.4.7", | ||
"@types/react": "^16.9.34", | ||
"@types/react-dom": "^16.9.7", | ||
"conventional-github-releaser": "^3.1.3", | ||
"jest": "^24.9.0", | ||
"microbundle": "^0.11.0", | ||
"react": "^16.9.0", | ||
"react-dom": "^16.9.0", | ||
"standard-version": "^7.0.0" | ||
"jest": "^26.1.0", | ||
"microbundle": "^0.12.3", | ||
"react": "^16.13.1", | ||
"react-dom": "^16.13.1", | ||
"standard-version": "^8.0.2", | ||
"tsdx": "^0.13.2", | ||
"tslib": "^2.0.0", | ||
"typescript": "^3.8.3" | ||
} | ||
} |
# react-merge-refs | ||
[![License](https://img.shields.io/npm/l/react-merge-refs.svg)](https://github.com/smooth-code/react-merge-refs/blob/master/LICENSE) | ||
[![License](https://img.shields.io/npm/l/react-merge-refs.svg)](https://github.com/gregberge/react-merge-refs/blob/master/LICENSE) | ||
[![npm package](https://img.shields.io/npm/v/react-merge-refs/latest.svg)](https://www.npmjs.com/package/react-merge-refs) | ||
[![Build Status](https://img.shields.io/travis/smooth-code/react-merge-refs.svg)](https://travis-ci.org/smooth-code/react-merge-refs) | ||
[![DevDependencies](https://img.shields.io/david/dev/smooth-code/react-merge-refs.svg)](https://david-dm.org/smooth-code/react-merge-refs?type=dev) | ||
[![Build Status](https://img.shields.io/travis/gregberge/react-merge-refs.svg)](https://travis-ci.org/gregberge/react-merge-refs) | ||
[![DevDependencies](https://img.shields.io/david/dev/gregberge/react-merge-refs.svg)](https://david-dm.org/gregberge/react-merge-refs?type=dev) | ||
@@ -17,9 +17,9 @@ React utility to merge refs 🖇 | ||
```js | ||
import React from 'react' | ||
import mergeRefs from 'react-merge-refs' | ||
import React from "react"; | ||
import mergeRefs from "react-merge-refs"; | ||
const Example = React.forwardRef(function Example(props, ref) { | ||
const localRef = React.useRef() | ||
return <div ref={mergeRefs([localRef, ref])} /> | ||
}) | ||
const localRef = React.useRef(); | ||
return <div ref={mergeRefs([localRef, ref])} />; | ||
}); | ||
``` | ||
@@ -26,0 +26,0 @@ |
@@ -6,3 +6,3 @@ export default function mergeRefs(refs) { | ||
ref(value) | ||
} else if (ref !== null && ref !== undefined) { | ||
} else if (ref != null) { | ||
ref.current = value | ||
@@ -9,0 +9,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
8408
14
63
2