react-native-merlin
react-native-merlin copied to clipboard
When you use validation on a component with multiple child inputs pressing enter on the previous input will throw an error
- Set up two components, one standard input and one custom component with multiple inputs as children

- Press enter while in the first component, it will try to find the next input field from the ref but as the ref is actually a custom component and not an input the 'current' value is null. This will throw an error. Merlin.js (line 141)

const nextFocusableInput = nextInputs.find( (element) => inputRefs[element.props.name]?.current?.focus )
This would ignore the next input and just submit the form, not ideal but would stop the error from happening. The other solution would be to look for input children in a custom component with a ref.