Skip to content

Commit 08ce970

Browse files
author
Edward Xiao
committed
- fix cached issue on <Radiobox/> item click
1 parent de545ae commit 08ce970

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

lib/components/Radiobox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ var Option = memo(function (_ref2) {
394394
onChange = _ref2$onChange === void 0 ? function () {} : _ref2$onChange;
395395
var handleOnChange = useCallback(function (e) {
396396
onChange(item.id, e);
397-
}, []);
397+
}, [item]);
398398
return React.createElement("button", {
399399
type: "button",
400400
className: optionListItemClass,

lib/react-inputs-validation.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/react-inputs-validation.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/react-inputs-validation.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/react-inputs-validation.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-inputs-validation",
3-
"version": "4.1.6",
3+
"version": "4.1.7",
44
"description": "React form input validation components",
55
"main": "index.js",
66
"repository": {
@@ -29,7 +29,7 @@
2929
"build_prod": "npm run webpack_prod",
3030
"build_umd": "./node_modules/.bin/webpack --config ./webpack/umd.config.js",
3131
"build_umd_min": "./node_modules/.bin/webpack --config ./webpack/umd.config.js --env build",
32-
"server_dev": "node_modules/.bin/webpack-dev-server --config ./webpack/development.config.js",
32+
"dev": "node_modules/.bin/webpack-dev-server --config ./webpack/development.config.js",
3333
"server_prod": "node_modules/.bin/webpack-dev-server --config ./webpack/production.config.js",
3434
"clean": "rimraf dist lib",
3535
"compile_webpack": "npm run clean && npm run build_umd && npm run build_umd_min",

src/js/Inputs/Radiobox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ export const Option: React.FC<OptionProps> = memo(
325325
}) => {
326326
const handleOnChange = useCallback(e => {
327327
onChange(item.id, e);
328-
}, []);
328+
}, [item]);
329329
return (
330330
<button type="button" className={optionListItemClass} style={customStyleOptionListItem} onClick={handleOnChange}>
331331
<input

0 commit comments

Comments
 (0)