React NativeOnline React Native compiler, Online React Native IDE, and online React Native REPL.

Code React Native, compile React Native, run React Native, and host your programs and apps online for free.

loading
repl talk
(games)
Files
  • index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import React from 'react';
import { Button, View } from 'react-native';

const pressCount = 0;

export default class App extends React.Component {
  constructor(props) {
    super(props)

    this.state = {
      pressCount: 0,
    }
  }

  componentDidUpdate() {
    console.log('Press Count: ', this.state.pressCount);
  }

  render() {
    return (
      <View style={{position: 'relative', top: 100}}>
        <Button
          title="Press Me!"
          onPress={() => this.setState({pressCount: this.state.pressCount + 1})}
        />
      </View>
    )
  }
}