import React from "react"; import { StyleSheet, Text, TouchableOpacity, View } from "react-native"; import { useDispatch, useSelector } from "react-redux"; import { decrement, increment } from "../store/actions"; export const Counter = () => { const dispatch = useDispatch() const value = useSelector(s => s.test.value) return ( {value} dispatch(increment())}> Increment dispatch(decrement())}> Decrement ) } const styles = StyleSheet.create({ row: { flexDirection: "row", }, flex: { flex: 1 }, justifySpaceBetween: { justifyContent: 'space-between' }, button: { backgroundColor: "#D9F1EC", padding: '3%', marginTop: '10%' }, textAlignCenter: { textAlign: 'center' }, justifyCenter: { justifyContent: 'center' }, alignCenter: { alignItems: 'center' } })