react native counter

Solutions on MaxInterview for react native counter by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
showing results for - "react native counter"
Darla
28 Nov 2017
1// React Native Counter Example using Hooks!
2import React, { useState } from 'react';import { View, Text, Button, StyleSheet } from 'react-native';
3const App = () => {  const [count, setCount] = useState(0);
4  return (    <View style={styles.container}>      <Text>You clicked {count} times</Text>      <Button        onPress={() => setCount(count + 1)}        title="Click me!"      />    </View>  );};
5// React Native Styles
6const styles = StyleSheet.create({  container: {    flex: 1,    justifyContent: 'center',    alignItems: 'center'  }});