GithubHelp home page GithubHelp logo

Comments (6)

moschan avatar moschan commented on August 11, 2024

Sorry for late.

I will implement this weekend.

Thank you.

from react-native-simple-radio-button.

moschan avatar moschan commented on August 11, 2024

I'm working now.
Please wait a little more..

from react-native-simple-radio-button.

ajoshdee avatar ajoshdee commented on August 11, 2024

Looking forward to your updates soon. Thanks

from react-native-simple-radio-button.

ajoshdee avatar ajoshdee commented on August 11, 2024

Any news?

from react-native-simple-radio-button.

moschan avatar moschan commented on August 11, 2024

Sorry for late.

I updated to 2.0.0
You can use like this:

import RadioForm, {RadioButton, RadioButtonInput, RadioButtonLabel} from 'react-native-simple-radio-button';
<Text style={styles.welcome}>3. Pro</Text>
<View style={styles.component}>
  <RadioForm formHorizontal={true} animation={true} >
    {this.state.types3.map((obj, i) => {
      var onPress = (value, index) => {
          this.setState({
            value3: value,
            value3Index: index
          })
        }
      return (
        <RadioButton labelHorizontal={true} key={i} >
          {/*  You can set RadioButtonLabel before RadioButtonInput */}
          <RadioButtonInput
            obj={obj}
            index={i}
            isSelected={this.state.value3Index === i}
            onPress={onPress}
            buttonInnerColor={'#e74c3c'}
            buttonOuterColor={'#2196f3'}
            buttonSize={40}
            buttonStyle={{}}
            buttonWrapStyle={{marginLeft: 10}}
          />
          <RadioButtonLabel
            obj={obj}
            index={i}
            labelHorizontal={true}
            onPress={onPress}
            labelStyle={{fontSize: 20, color: '#2ecc71'}}
            labelWrapStyle={{}}
          />
        </RadioButton>
      )
    })}
  </RadioForm>
</View>
<Text>selected: {this.state.types3[this.state.value3Index].label}</Text>

I also updated example(index.ios.js). Check this.

And, I have not updated README. I will update soon.

Thanks!

from react-native-simple-radio-button.

ajoshdee avatar ajoshdee commented on August 11, 2024

What if i don't want to save it to state? I have multiple sets of radio buttons. For example, i have a multiple choice form with 50 questions. I can't have all 50 inside a state.

from react-native-simple-radio-button.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.