Skip to content

Instantly share code, notes, and snippets.

View soska's full-sized avatar
🏠
Working from home

Armando Sosa soska

🏠
Working from home
View GitHub Profile
@soska
soska / login.jsx
Created May 6, 2015 21:44
Login React Component
const React = require('react');
const Login = React.createClass({
propTypes:{
username : React.PropTypes.string,
password : React.PropTypes.string,
startWithLogin : React.PropTypes.bool,
error : React.PropTypes.string,
onLogin : React.PropTypes.func,
@soska
soska / app.js
Last active August 29, 2015 14:23
silly react app
'use strict';
const React = require('react');
const App = React.createClass({
getInitialState(){
return {
hello : 'world'
};
},
@soska
soska / index.jsx
Created June 25, 2015 20:03
App Builder In React
'use strict';
const React = require('react');
const AdBuilder = React.createClass({
getInitialState(){
return {
creative : CreativeStore.getEmptyCreative(),
selectedWidget : null
}
@soska
soska / tabs.jsx
Created December 28, 2015 19:15
Tabs Component
import React, {Children, cloneElement} from 'react';
import cx from 'classnames';
export const Tabs = ({
onChange = () => {},
selectedIndex = 0,
TabListComponent = TabList,
children,
}) => {
@soska
soska / EditableValue.js
Created August 2, 2016 00:17
An editable div component
class EditableValue extends Component{
static defaultProps = {
onChange: ()=>{},
type: 'text'
};
constructor(props){
super(props);

How to use SASS with create-react-app

This will require only one dependency, and one line added to your package.json and it's super fast.

  1. Create an app wih create-react-app.
  2. Install node-sass.
  3. Create your base sass file inside src/sass.
  4. Add a new script to package json that will watch the file, process sass and compile it into src/css.
  5. Include the compiled css into React via require, this way your app will reload whenever the new css is compiled.
  6. ran the new script along with npm start.
@soska
soska / index.html
Created December 29, 2016 14:32 — forked from anonymous/index.html
Musical Chord Progression Arpeggiator
<article>
<aside id="aside"></aside>
<main id="main"></main>
</article>
@soska
soska / test.js
Created March 11, 2017 01:55
testingscript
alert('testing');
@soska
soska / keeper.js
Created November 24, 2017 17:20
An idea for a simple component-based state manager
import { Component } from 'react';
class Keeper extends Component{
static defaultProps = {
initialState:{},
stateRoot:'keeper',
reducer:state=>state,
serialize:null
}
const defaultPluginOptions = {
extension: /\.worker.js$/,
};
const plugin = (config, pluginOptions, nextOptions) => {
const { extension } = pluginOptions;
config.module.rules.push({
test: extension,
use: [