Skip to content

Instantly share code, notes, and snippets.

@YoneMoreno
YoneMoreno / FirstComponent.js
Created October 29, 2017 12:18
Samerbuna Learning React Clip First Component
class Button extends React.Component {
state = {counter: 0};
handleClick = () => {
this.setState((prevState) => ({
counter: prevState.counter + 1
}));
};
render(){
@YoneMoreno
YoneMoreno / ReusableComponents.js
Created October 29, 2017 15:32
Samerbuna Learning React Clip First Component
class Button extends React.Component {
handleClick = () => {
this.props.onClickFunction(this.props.incrementValue);
};
render() {
return (
<button onClick={this.handleClick}>
@YoneMoreno
YoneMoreno / BuildAGitHubCardComponent.js
Created October 29, 2017 16:10
Samerbuna Learning React Clip First Component
const Card = (props)=> {
return (
<div style={{margin: '1em'}}>
<img width="75" src={props.avatar_url} />
<div style={{display: 'inline-block', marginLeft:10}}>
<div style={{fontSize: '1.25em', fontWeight: 'bold'}}>{props.name}</div>
<div>{props.company}</div>
</div>
</div>
);
@YoneMoreno
YoneMoreno / TakingInputFromTheUser.js
Created October 29, 2017 16:57
Samerbuna Learning React Clip First Component
const Card = (props)=> {
return (
<div style={{margin: '1em'}}>
<img width="75" src={props.avatar_url} />
<div style={{display: 'inline-block', marginLeft:10}}>
<div style={{fontSize: '1.25em', fontWeight: 'bold'}}>{props.name}</div>
<div>{props.company}</div>
</div>
</div>
);
@YoneMoreno
YoneMoreno / CSS.css
Created October 29, 2017 18:26
Samerbuna Learning React Clip First Component
.mountNode {
color: #333;
}
.fa-star{
margin: 0.5em;
font-size: 24px;
}
span {
@YoneMoreno
YoneMoreno / TheStateOfSelectedNumbers.js
Created October 30, 2017 06:51
Samer Buna Module 5 Numbers Selection
const Stars = (props) => {
const numberOfStars = 1 + Math.floor(Math.random()*9);
/*
let stars = [];
for(let i=0; i<numberOfStars; i++){
stars.push(<i key={i} className="fa fa-star"></i>);
}
*/
return (
<div className="col-5">
@YoneMoreno
YoneMoreno / SelectingANumber.js
Created October 30, 2017 07:06
Samer Buna Module 5 Creating a Game for kids React
const Stars = (props) => {
/*
let stars = [];
for(let i=0; i<numberOfStars; i++){
stars.push(<i key={i} className="fa fa-star"></i>);
}
*/
return (
<div className="col-5">
@YoneMoreno
YoneMoreno / ChanginTheAnswer.js
Created October 30, 2017 07:17
Samer Buna React
const Stars = (props) => {
/*
let stars = [];
for(let i=0; i<numberOfStars; i++){
stars.push(<i key={i} className="fa fa-star"></i>);
}
*/
return (
<div className="col-5">
@YoneMoreno
YoneMoreno / Enhancing the UI.js
Created October 30, 2017 07:24
Samer Buna React
const Stars = (props) => {
/*
let stars = [];
for(let i=0; i<numberOfStars; i++){
stars.push(<i key={i} className="fa fa-star"></i>);
}
*/
return (
<div className="col-5">
@YoneMoreno
YoneMoreno / VeryfingAnAnswer.js
Created October 30, 2017 07:41
Samer Buna Getting Started React
const Stars = (props) => {
/*
let stars = [];
for(let i=0; i<numberOfStars; i++){
stars.push(<i key={i} className="fa fa-star"></i>);
}
*/
return (
<div className="col-5">