项目作者: tsepeti

项目描述 :
Simple radio button component for React Native
高级语言: JavaScript
项目地址: git://github.com/tsepeti/rnative-radio-buttons.git
创建时间: 2020-03-17T20:28:06Z
项目社区:https://github.com/tsepeti/rnative-radio-buttons

开源协议:

下载





Simple radio button component for React Native

Installation

To install a stable release use:

yarn

  1. yarn add rnative-radio-buttons

npm

  1. npm i rnative-radio-buttons --save

Example

  1. import RadioButtons from 'rnative-radio-buttons';
  2. const options = [
  3. { label: 'Erkek', value: 'E' },
  4. { label: 'Kadın', value: 'K' },
  5. ];
  6. class Index extends Component {
  7. state = {
  8. value: 'E'
  9. };
  10. render() {
  11. return (
  12. <RadioButtons
  13. options={options}
  14. selected={this.state.value}
  15. onPress={(value) => {
  16. return this.setState({ value })
  17. }}
  18. />
  19. )
  20. }
  21. }