Skip to content

Instantly share code, notes, and snippets.

@christiannwamba christiannwamba/block6.js Secret
Created May 26, 2018

What would you like to do?
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
class App extends Component {
this.state = {
number : 0
render() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h1 className="App-title">Welcome to React</h1>
<p className="App-intro">
Will the state be preserved? The value is {this.state.number}
<button onClick={()=>this.setState({number : this.state.number + 1})}>+</button>
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.