Skip to content

Instantly share code, notes, and snippets.

class Parent extends React.Component {
constructor(...args) {
super(args);
this.state = {
renderChild: true
}
this.interval = null;
}
const input = [
'racecar',
'racecarff',
'abbccc',
'a',
'aabb',
'cabc',
];
input.forEach(word => {
@BTMPL
BTMPL / Build.md
Created September 20, 2017 12:46 — forked from Eoksni/Build.md
Minimal Webpack DllPlugin example

Compile with:

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

Use with the following index.html

import React from "react";
import { render } from "react-dom";
import PropTypes from "prop-types";
class TweetForm extends React.Component {
state = {
text: ''
}
@BTMPL
BTMPL / component.js
Last active December 8, 2018 15:15 — forked from Ayyagaries/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,
import React from "react";
import { render } from "react-dom";
import PropTypes from "prop-types";
class TweetForm extends React.Component {
setRef = (el) => {
this.textArea = el;
}
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) {
var path = require("path");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
const ETP = new ExtractTextPlugin({
allChunks: true
});
module.exports = [
{
test: /\.js$/,
@gutter: 8px;
.Row {
display: flex;
max-width: 1170px;
margin: 0 auto;
flex-wrap: wrap;
@media screen and (max-width: 640px) {
@BTMPL
BTMPL / 01-state-is-asynchronous.js
Created April 17, 2017 08:06
Understanding setState
// assuming this.state = { value: 0 }
this.setState({
value: 1
});
console.log(this.state.value); // 0