Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mport React, { Component } from 'react';
- import { Alert, AppRegistry, Platform, StyleSheet, Text, TouchableNativeFeedback, TouchableWithoutFeedback, View } from 'react-native';
- class Button extends Component {
- constructor(props) {
- super(props);
- this.state = {status: "-"};
- }
- // _onPressButton(num) {
- // this.state.board[num] =
- // }
- render() {
- <View style={styles.button}>
- <Text style={styles.buttonText}>TouchableWithoutFeedback</Text>
- </View>
- }
- }
- export default class Board extends Component {
- constructor(props) {
- super(props);
- this.state = {board: Array(9).fill("-"), turn: false};
- }
- _onPressButton(num, status, turn) {
- if (status == "-") {
- newStatus = turn
- this.setState( () => {
- return { board[num]: turn, turn: !turn }
- })
- }
- this.state.board[num] =
- }
- render() {
- return (
- <View>
- </View>
- );
- }
- }
- const styles = StyleSheet.create({
- container: {
- paddingTop: 60,
- alignItems: 'center'
- },
- button: {
- marginBottom: 30,
- width: 100,
- height: 100,
- alignItems: 'center',
- backgroundColor: '#2196F3'
- },
- buttonText: {
- fontSize: 50,
- padding: 20,
- color: 'white',
- alignText: 'center',
- fontWeight: 'bold',
- }
- })
- // skip this line if using Create React Native App
- AppRegistry.registerComponent('TicTacToe', () => TicTacToe);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement