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>
)
}
}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'}
/>
Also in JavaScript:
- how do I use const in javascript
- ajouter un lien href dans du javascript
- react add inline styles in react
- input text react 2020
- settimeout node js
- jquery extract number from string
- js find space in string
- js axios progress
- hide label chratjs
- signup form in angular 9
- react suspense chunck
- javascript remove element
- jquery populate form json
- import state react
- how to read json file with gluegun
- fill checkbox javascript
- hide warnings in expo app
- react router tutorial medium
- react native timed out waiting for modules to be invalidated
- javascript append to array
- sinh(x)
- foreach loop js arrow functons
- javascript parse json
- how to cause a whole page reload react redux