From 088b247ad9a6f42d04fae8d62834b48c42f89dee Mon Sep 17 00:00:00 2001 From: komv8i Date: Thu, 7 Feb 2019 11:22:58 -0500 Subject: [PATCH 1/2] change password revealer component to hooks implementation --- snippets/PasswordRevealer.md | 38 +++++++++++++++--------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/snippets/PasswordRevealer.md b/snippets/PasswordRevealer.md index 731f1030b..24263d8ff 100644 --- a/snippets/PasswordRevealer.md +++ b/snippets/PasswordRevealer.md @@ -8,30 +8,24 @@ In the`render()` method, use a`
` to wrap both the`` and the ` -
- ); - } + return ( +
+ {}} + /> + +
+ ); } ``` From 145883c2c1258f6ade7efc7865f10f1645a861ef Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Tue, 12 Feb 2019 20:19:35 +0200 Subject: [PATCH 2/2] Update PasswordRevealer.md --- snippets/PasswordRevealer.md | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/snippets/PasswordRevealer.md b/snippets/PasswordRevealer.md index 24263d8ff..7e27c3e09 100644 --- a/snippets/PasswordRevealer.md +++ b/snippets/PasswordRevealer.md @@ -2,19 +2,12 @@ Renders a password input field with a reveal button. -Initially set `state.shown` to `false` to ensure that the password is not shown by default. -Create a method, `toggleShown`, which uses `Component.prototype.setState` to change the input's state from shown to hidden and vice versa, bind it to the component's context. -In the`render()` method, use a`
` to wrap both the`` and the ` +
); }