@radix-ui/react-checkbox
Advanced tools
Comparing version 1.0.1 to 1.0.2-rc.1
@@ -51,2 +51,16 @@ var $dKOox$babelruntimehelpersextends = require("@babel/runtime/helpers/extends"); | ||
}); | ||
const initialCheckedStateRef = $dKOox$react.useRef(checked); | ||
$dKOox$react.useEffect(()=>{ | ||
const form = button === null || button === void 0 ? void 0 : button.form; | ||
if (form) { | ||
const reset = ()=>setChecked(initialCheckedStateRef.current) | ||
; | ||
form.addEventListener('reset', reset); | ||
return ()=>form.removeEventListener('reset', reset) | ||
; | ||
} | ||
}, [ | ||
button, | ||
setChecked | ||
]); | ||
return /*#__PURE__*/ $dKOox$react.createElement($a17f2c9fbf2ccf8c$var$CheckboxProvider, { | ||
@@ -53,0 +67,0 @@ scope: __scopeCheckbox, |
import $1bpvS$babelruntimehelpersesmextends from "@babel/runtime/helpers/esm/extends"; | ||
import {forwardRef as $1bpvS$forwardRef, useState as $1bpvS$useState, useRef as $1bpvS$useRef, createElement as $1bpvS$createElement, useEffect as $1bpvS$useEffect} from "react"; | ||
import {forwardRef as $1bpvS$forwardRef, useState as $1bpvS$useState, useRef as $1bpvS$useRef, useEffect as $1bpvS$useEffect, createElement as $1bpvS$createElement} from "react"; | ||
import {useComposedRefs as $1bpvS$useComposedRefs} from "@radix-ui/react-compose-refs"; | ||
@@ -39,2 +39,16 @@ import {createContextScope as $1bpvS$createContextScope} from "@radix-ui/react-context"; | ||
}); | ||
const initialCheckedStateRef = $1bpvS$useRef(checked); | ||
$1bpvS$useEffect(()=>{ | ||
const form = button === null || button === void 0 ? void 0 : button.form; | ||
if (form) { | ||
const reset = ()=>setChecked(initialCheckedStateRef.current) | ||
; | ||
form.addEventListener('reset', reset); | ||
return ()=>form.removeEventListener('reset', reset) | ||
; | ||
} | ||
}, [ | ||
button, | ||
setChecked | ||
]); | ||
return /*#__PURE__*/ $1bpvS$createElement($e698a72e93240346$var$CheckboxProvider, { | ||
@@ -41,0 +55,0 @@ scope: __scopeCheckbox, |
{ | ||
"name": "@radix-ui/react-checkbox", | ||
"version": "1.0.1", | ||
"version": "1.0.2-rc.1", | ||
"license": "MIT", | ||
@@ -40,3 +40,4 @@ "source": "src/index.ts", | ||
"url": "https://github.com/radix-ui/primitives/issues" | ||
} | ||
}, | ||
"stableVersion": "1.0.1" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
53511
354
1