Answers for "react native toggle button with text"

0

react native toggle button with text

import React, { Component } from 'react'
import { View, Text, Button } from 'react-native'

export default class App extends Component {
  state = {
    textValue: 'Change me'
  }

  onPress = () => {
    this.setState({
      textValue: 'THE NEW TEXT GOES HERE'
    })
  }

  render() {
    return (
      <View style={{paddingTop: 25}}>
        <Text>{this.state.textValue}</Text>
        <Button title="Change Text" onPress={this.onPress} />
      </View>
    )
  }
}
Posted by: Guest on February-17-2021
-1

react native toggle button with text

import { Switch } from 'react-native-switch';

<Switch
	value={true}  
	onValueChange={(val) => console.log(val)}
	disabled={false}
	activeText={'On'}
	inActiveText={'Off'}
	backgroundActive={'green'}
	backgroundInactive={'gray'}
	circleActiveColor={'#30a566'}
	circleInActiveColor={'#000000'}
/>
Posted by: Guest on February-17-2021

Code answers related to "react native toggle button with text"

Code answers related to "Javascript"

Browse Popular Code Answers by Language