Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"strconv"
)
// Always make sure to use the variables you have declared
// otherwise the build fails
@adithyamaheshb
adithyamaheshb / Counter.js
Created June 7, 2018 05:37
Increment/Decrement Counter
import React, { Component } from 'react';
class App extends Component {
constructor(props) {
super(props);
this.state = {
clicks: 0,
show: true
};
this.IncrementItem = this.IncrementItem.bind(this);
@adithyamaheshb
adithyamaheshb / App.js
Created June 7, 2018 03:43
Component LifeCycle methods in React
import React, { Component } from 'react';
import LifeCycle from './LifeCycle';
class App extends Component {
constructor(props) {
super(props);
this.state = {
counter: 0
};
this.incrementCounter = this.incrementCounter.bind(this);
@adithyamaheshb
adithyamaheshb / ToDo.js
Last active June 7, 2018 06:14
Basic React Component for a ToDo List
import React, {Component} from 'react';
const List = props => (
<ul>
{
props.itmes.map((item, index) => <li key={index}>{item}</li>)
}
</ul>
);