@maskito/react
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -28,3 +28,3 @@ 'use strict'; | ||
const useMaskito = ({ | ||
options = core.MASKITO_DEFAULT_OPTIONS, | ||
options = null, | ||
elementPredicate = core.MASKITO_DEFAULT_ELEMENT_PREDICATE | ||
@@ -56,3 +56,3 @@ } = {}) => { | ||
useIsomorphicLayoutEffect(() => { | ||
if (!element) { | ||
if (!element || !options) { | ||
return; | ||
@@ -59,0 +59,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { Maskito, MASKITO_DEFAULT_OPTIONS, MASKITO_DEFAULT_ELEMENT_PREDICATE } from '@maskito/core'; | ||
import { Maskito, MASKITO_DEFAULT_ELEMENT_PREDICATE } from '@maskito/core'; | ||
import { useLayoutEffect, useEffect, useState, useCallback, useRef } from 'react'; | ||
@@ -25,3 +25,3 @@ | ||
const useMaskito = ({ | ||
options = MASKITO_DEFAULT_OPTIONS, | ||
options = null, | ||
elementPredicate = MASKITO_DEFAULT_ELEMENT_PREDICATE | ||
@@ -53,3 +53,3 @@ } = {}) => { | ||
useIsomorphicLayoutEffect(() => { | ||
if (!element) { | ||
if (!element || !options) { | ||
return; | ||
@@ -56,0 +56,0 @@ } |
{ | ||
"name": "@maskito/react", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "The React-specific Maskito's library", | ||
@@ -35,4 +35,4 @@ "keywords": [ | ||
"@testing-library/user-event": "14.5.2", | ||
"@types/react": "18.2.61", | ||
"@types/react-dom": "18.2.19", | ||
"@types/react": "18.2.64", | ||
"@types/react-dom": "18.2.21", | ||
"react": "18.2.0", | ||
@@ -43,3 +43,3 @@ "react-dom": "18.2.0", | ||
"peerDependencies": { | ||
"@maskito/core": "^2.1.0", | ||
"@maskito/core": "^2.2.0", | ||
"react": ">=16.8", | ||
@@ -46,0 +46,0 @@ "react-dom": ">=16.8" |
@@ -1,3 +0,3 @@ | ||
import { MaskitoElementPredicate, MaskitoOptions } from '@maskito/core'; | ||
import { RefCallback } from 'react'; | ||
import type { MaskitoElementPredicate, MaskitoOptions } from '@maskito/core'; | ||
import type { RefCallback } from 'react'; | ||
/** | ||
@@ -18,5 +18,5 @@ * Hook for convenient use of Maskito in React | ||
export declare const useMaskito: ({ options, elementPredicate, }?: { | ||
options?: MaskitoOptions | undefined; | ||
options?: MaskitoOptions | null | undefined; | ||
elementPredicate?: MaskitoElementPredicate | undefined; | ||
}) => RefCallback<HTMLElement>; | ||
//# sourceMappingURL=useMaskito.d.ts.map |
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
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
8363