Skip to content

Conversation

@kodejuice
Copy link

No description provided.

const [containerIsFocused, setContainerIsFocused] = useState(false);

const codeDigitsArray = new Array(CODE_LENGTH);
const codeDigitsArray = [...Array(CODE_LENGTH)];
Copy link
Author

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

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) => {
Copy link
Author

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 = [
Copy link
Author

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

@kodejuice
Copy link
Author

@jferris @cpytel @mike-burns care to review / merge this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants