Skip to content

Commit

Permalink
Merge pull request #99 from sam1463/master
Browse files Browse the repository at this point in the history
add onRef prop to Input component for passing ref to rn text input
  • Loading branch information
palingheorghe authored Sep 11, 2019
2 parents 13d074b + 5d5d544 commit 312da51
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Input extends React.Component {

render() {
const {
onRef,
style,
type,
password,
Expand Down Expand Up @@ -96,6 +97,7 @@ class Input extends React.Component {
<View style={inputViewStyles}>
{left && !right && iconInstance}
<TextInput
ref={onRef}
style={inputStyles}
keyboardType={type}
secureTextEntry={isPassword}
Expand Down Expand Up @@ -135,6 +137,7 @@ Input.defaultProps = {
iconSize: null,
iconContent: null,
theme: GalioTheme,
onRef: null,
};

Input.propTypes = {
Expand All @@ -160,6 +163,7 @@ Input.propTypes = {
iconSize: PropTypes.number,
iconContent: PropTypes.any,
theme: PropTypes.any,
onRef: PropTypes.func,
};

const styles = theme =>
Expand Down

0 comments on commit 312da51

Please sign in to comment.