Skip to content

Instantly share code, notes, and snippets.

View reciosonny's full-sized avatar
🎯
Focusing

Sonny R. Recio reciosonny

🎯
Focusing
View GitHub Profile
function App() {
const [firstName, setFirstName] = useState("");
const [middleName, setMiddleName] = useState("");
const [lastName, setLastName] = useState("");
return (
<div className="App">
</div>
function PersonalInformation({
firstName,
middleName,
lastName,
setFirstName,
setMiddleName,
setLastName
}) {
return (
<div>
export default class ContainerComponent extends Component {
state = { firstName: "", lastName: "", address: "", data: [] };
componentDidMount() {
axios.get("/url/blablabla").then(res => this.setState({ data: res.data }));
}
onChangeEvent = () => {
// Complex logic here...
import styled from "styled-components";
const Button = styled.a`
text-decoration: none;
color: #fff;
background-color: #26a69a;
text-align: center;
letter-spacing: 0.5px;
@reciosonny
reciosonny / mixins-boilerplate.scss
Last active August 3, 2019 03:11
Boilerplate for mixins
// MEDIA QUERY MANAGER
/*
0 - 600px: Phone
600 - 900px: Tablet portrait
900 - 1200px: Tablet landscape
[1200 - 1800] is where our normal styles apply
1800px + : Big desktop
$breakpoint arguement choices:
- phone
use iframer;
update sale s set FullyPaid=1
where YEAR(s.Created) between 2012 and 2018 and s.FramerID = 'bea8ac99-04dd-48da-8db8-ba572bf8ffe2';
select * from sale s
@reciosonny
reciosonny / fluxActionCreators.js
Created October 14, 2018 05:15
Flux sample action creators
import AppDispatcher from './AppDispatcher';
export const updateNumberOfPeople = (value) => {
const action = { type: 'UPDATE_NUMBER_OF_PEOPLE', value };
AppDispatcher.dispatch(action);
}
export const updateSlicesPerPerson = (value) => {
const initialState = {
numberOfPeople: 10,
slicesPerPerson: 2,
};
//We then use this HOC like so: WithCalculator(**component goes here**)
//This makes use of arrow functions(=>) and anonymous class construction(returns `class`)
const WithCalculator = WrappedComponent => {
return class extends Component {
static displayName = `WithCalculator(${WrappedComponent.displayName ||
import React, { Component } from 'react';
// import axios from 'axios';
import AnotherComponent from './AnotherComponent';
import Todo from './Todo';
import ParentComponent from './ParentComponent';
export default class App extends ParentComponent {
constructor(props) {
import React, { Component } from 'react';
// import axios from 'axios';
import AnotherComponent from './AnotherComponent';
import Todo from './Todo';
import ParentComponent from './ParentComponent';
export default class App extends Component {
constructor(props) {