Skip to content

Commit a1da318

Browse files
committed
bug fix patch
1 parent 6025230 commit a1da318

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ A lightweight package to toggle password visibility on click of the icon. you ne
1818
- **inputRef** - this is required props , here you need to supply ref of password input field as this prop val,
1919
- **showIcon** - default value for this field is "Show", but here you can pass cutsom funtion which return html of the image tag or icon tag or any icon or text which you want to show.
2020
- **hideIcon** - defaut value fot this fied is "Hide", here also you can provide callback function same as the showIcon if you want to render icon or something else as per your need.
21-
**here is snippet for your ref**
21+
22+
### Here is snippet for showing icon
2223
### Code
2324

2425
``` js
@@ -35,10 +36,10 @@ as per above code you need to follow three steps:
3536
- create input and give assign ref to it and place it in div which we have created in previous step
3637
- now import react-password-toggle-icon place it in same div and pass inputRef prop whose value is set to inputfield ref
3738

38-
### Code Sandbox link
39-
[a link](https://codesandbox.io/s/react-password-toggle-icon-forked-rd2xz)
39+
### Example
40+
[Code Sandbox](https://codesandbox.io/s/react-password-toggle-icon-forked-rd2xz)
4041

41-
Hope This package will help 😊
42+
Hope This package will helpful 😊
4243

4344
cheers 🥂!!
4445

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-password-toggle-icon",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"description": "a lightweight password hide show package",
55
"main": "dist/index.js",
66
"repository": {

src/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class App extends React.PureComponent {
4646

4747
const {isVisible} = this.state;
4848
const hideVal = typeof hideIcon === "string" ? hideIcon : hideIcon();
49-
const showVal = typeof showVal === "string" ? showIcon : showIcon();
49+
const showVal = typeof showIcon === "string" ? showIcon : showIcon();
5050
return (
5151
<div className={"react-password-toggle-icon-wrapper"+" "+parentClassName} onClick={() => this.handleClick(inputRef)} style={{...defaultStyle,...style}}>
5252
{isVisible ? hideVal : showVal}

0 commit comments

Comments
 (0)