-
-
Notifications
You must be signed in to change notification settings - Fork 6
Several code improvements #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| const [containerIsFocused, setContainerIsFocused] = useState(false); | ||
|
|
||
| const codeDigitsArray = new Array(CODE_LENGTH); | ||
| const codeDigitsArray = [...Array(CODE_LENGTH)]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use spread operator to create array of CODE_LENGTH length, the original code could not be mapped
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixed my issue as well. Otherwise, the fields do not show.
|
|
||
| const ref = useRef<TextInput>(null); | ||
|
|
||
| const setCodeInput = (input: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ignore non-numeric input
| containerIsFocused && isFocused | ||
| ? {...style.inputContainer, ...style.inputContainerFocused} | ||
| : style.inputContainer; | ||
| const containerStyle = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the style prop can accept an array of styles
|
@jferris @cpytel @mike-burns care to review / merge this? |
No description provided.