react-native-form-generator icon indicating copy to clipboard operation
react-native-form-generator copied to clipboard

iconRight self.refs returns empty object

Open jesouhaite08 opened this issue 8 years ago • 3 comments

I am trying to get validation working, but self.refs is returning an empty object {}. Any idea why?

<InputField 
  ref='example_input_field' 
  placeholder='Full Name'
  containerStyle={globalStyles.formContentContainer}
  validationFunction = {(value)=>{return true;}}
  iconRight={
    <Icon name='ios-checkmark'
      size={30}
      style={[
        {marginTop:7, color:"#61d062" },
        ((self)=>{
          console.log('refs:', self.refs)
          //i can change the style of the component related to the attibute of example_input_field
          if(!!(self.refs && self.refs.example_input_field)){
            if(!self.refs.example_input_field.valid) return {color:'#d52222'}
          }
          }
        )(this)]}
      />
  }/>

jesouhaite08 avatar Dec 18 '16 02:12 jesouhaite08

+1

elhamsarikhani avatar Mar 18 '17 13:03 elhamsarikhani

same issue here

SiOuz avatar Apr 10 '17 16:04 SiOuz

Has anyone been able to resolve this?

LarryKiniu avatar Aug 05 '18 17:08 LarryKiniu