Skip to content

Commit

Permalink
fix target bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sw-yx committed Apr 20, 2019
1 parent 0c98a81 commit 3075d38
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"start": "rollup -c -w",
"prepare": "yarn run build",
"predeploy": "cd example && yarn install && yarn run build",
"prepublishOnly": "git push && git push --tags && gh-release",
"deploy": "gh-pages -d example/build"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function useInput(

let [value, setValue] = React.useState<typeof _initialValue>(_initialValue)
const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {
if (e.type === "checkbox") {
if (e.target.type === "checkbox") {
throw new Error(
"useInput error - type=checkbox specified, this is likely a mistake by the developer. you may want useCheckInput instead"
)
Expand Down Expand Up @@ -116,7 +116,7 @@ export function useCheckInput(

let [value, setValue] = React.useState<typeof _initialValue>(_initialValue)
const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {
if (e.type !== "checkbox") {
if (e.target.type !== "checkbox") {
throw new Error("useCheckInput error - no checkbox specified, this is likely a mistake by the developer")
}
const val = e.target.checked
Expand Down

0 comments on commit 3075d38

Please sign in to comment.