Skip to content

Instantly share code, notes, and snippets.

View component.js
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { StyleSheet, View, Alert } from 'react-native';
import Spinner from 'react-native-loading-spinner-overlay';
import {
Container,
Content,
Icon,
View workshop.js
import React from "react";
import { render } from "react-dom";
import PropTypes from "prop-types";
class TweetForm extends React.Component {
state = {
text: ''
}
View workshop.js
import React from "react";
import { render } from "react-dom";
import PropTypes from "prop-types";
class TweetForm extends React.Component {
setRef = (el) => {
this.textArea = el;
}
View test.diff
diff --git a/video_browser/src/components/video_detail.js b/video_browser/src/components/video_detail.js
index cb767d5..75ec611 100644
--- a/video_browser/src/components/video_detail.js
+++ b/video_browser/src/components/video_detail.js
@@ -1,12 +1,12 @@
import React from "react";
-const VideoDetail = ({ video }) => {
+const VideoDetail = ({ video, autoplay = false }) => {
if (!video) {
View l.js
var path = require("path");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
const ETP = new ExtractTextPlugin({
allChunks: true
});
module.exports = [
{
test: /\.js$/,
@BTMPL
BTMPL / Build.md
Created Sep 20, 2017 — forked from Eoksni/Build.md
Minimal Webpack DllPlugin example
View Build.md

Compile with:

webpack --config vendor.webpack.config.js
webpack --config app.webpack.config.js

Use with the following index.html

View palindrome.js
const input = [
'racecar',
'racecarff',
'abbccc',
'a',
'aabb',
'cabc',
];
input.forEach(word => {
View grid.less
@gutter: 8px;
.Row {
display: flex;
max-width: 1170px;
margin: 0 auto;
flex-wrap: wrap;
@media screen and (max-width: 640px) {
View 01-state-is-asynchronous.js
// assuming this.state = { value: 0 }
this.setState({
value: 1
});
console.log(this.state.value); // 0
View metaize-action.js
function test(params) {
return {
type: 'TEST',
payload: params
}
}
const metaizeThis = (fn) => {
fn._meta = {};
fn.addMeta = function(meta) {