From e84d0d74129445bb749774cc83da38acb22a446e Mon Sep 17 00:00:00 2001 From: Andrew Patton Date: Thu, 14 Oct 2021 17:24:57 -0700 Subject: [PATCH] Add story example to illustrate resetting ReactCodeInput #69 #129 --- src/ReactCodeInput.stories.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ReactCodeInput.stories.js b/src/ReactCodeInput.stories.js index 8304fba..7b8fe3e 100644 --- a/src/ReactCodeInput.stories.js +++ b/src/ReactCodeInput.stories.js @@ -117,4 +117,16 @@ propVariantStories ) .add('disabled', () => - ); + ) + .add('reset', ResetForm); + +function ResetForm() { + const [value, setValue] = React.useState(null); + + return ( + + setValue(null)} value={value} /> + + + ) +}