@os-design/use-forwarded-ref
Advanced tools
Comparing version 1.0.19 to 1.0.20
{ | ||
"name": "@os-design/use-forwarded-ref", | ||
"version": "1.0.19", | ||
"version": "1.0.20", | ||
"license": "UNLICENSED", | ||
"repository": "git@gitlab.com:os-team/libs/os-design.git", | ||
"main": "dist/cjs/index.js", | ||
"module": "dist/esm/index.js", | ||
"types": "dist/types/index.d.ts", | ||
"react-native": "src/index.ts", | ||
"type": "module", | ||
"main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"react-native": "./src/index.ts", | ||
"files": [ | ||
@@ -24,5 +24,4 @@ "dist", | ||
"clean": "rimraf dist", | ||
"build:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts,.tsx --out-dir dist/esm --source-maps", | ||
"build:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts,.tsx --out-dir dist/cjs --source-maps", | ||
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types", | ||
"build:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts,.tsx --out-dir dist", | ||
"build:types": "tsc -p tsconfig.build.json --emitDeclarationOnly --declaration --declarationDir dist", | ||
"build": "yarn clean && npm-run-all 'build:*'", | ||
@@ -37,3 +36,3 @@ "ncu": "ncu -u" | ||
}, | ||
"gitHead": "1f17189e344a56fd6347dd6b896d6e7ef6e7b35d" | ||
"gitHead": "86a83e87297a07afe132782ca2c95023b7139276" | ||
} |
import { | ||
ForwardedRef, | ||
MutableRefObject, | ||
RefObject, | ||
type ForwardedRef, | ||
type MutableRefObject, | ||
type RefObject, | ||
useCallback, | ||
@@ -19,5 +19,4 @@ useRef, | ||
try { | ||
// eslint-disable-next-line no-param-reassign | ||
(ref as MutableRefObject<T | null>).current = instance; | ||
} catch (error) { | ||
} catch { | ||
throw new Error(`Could not assign instance ${instance} to ref ${ref}.`); | ||
@@ -24,0 +23,0 @@ } |
Yes
4134
8
60