Skip to content

Instantly share code, notes, and snippets.

@zpao
zpao / foo.js
Created February 12, 2014 18:13
module.exports = {
componentWillMount: function() {
this.beforeMount && this.beforeMount();
}
componentWillUpdate: repeat,
componentDidMount: func that calls afterRender,
componentDidUpdate: repeate
}
diff --git a/src/core/React.js b/src/core/React.js
index 2c63e87..0039e4f 100644
--- a/src/core/React.js
+++ b/src/core/React.js
@@ -31,12 +31,38 @@ var ReactDefaultInjection = require('ReactDefaultInjection');
ReactDefaultInjection.inject();
+/**
+ * The primary entry point into the React library.
diff --git a/src/core/React.js b/src/core/React.js
index 0039e4f..2c63e87 100644
--- a/src/core/React.js
+++ b/src/core/React.js
@@ -31,38 +31,12 @@ var ReactDefaultInjection = require('ReactDefaultInjection');
ReactDefaultInjection.inject();
-/**
- * The primary entry point into the React library.
var CustomEvents = (function() {
var _map = {};
return {
subscribe: function(name, cb) {
_map[name] || (_map[name] = []);
_map[name].push(cb);
},
notify: function(name, data) {
@zpao
zpao / all (abc)
Last active December 31, 2015 04:19
5 Alexander Solovyov <[email protected]>
6 Andreas Svensson <[email protected]>
2 Andrew Zich <[email protected]>
4 Andrey Popp <[email protected]>
90 Ben Alpert <[email protected]>
96 Ben Newman <[email protected]>
1 Brian Cooke <[email protected]>
1 Brian Kim <[email protected]>
2 Brian Rue <[email protected]>
1 Cam Spiers <[email protected]>
diff --git a/src/dom/components/ReactDOMInput.js b/src/dom/components/ReactDOMInput.js
index a569a5e..698fc59 100644
--- a/src/dom/components/ReactDOMInput.js
+++ b/src/dom/components/ReactDOMInput.js
@@ -55,7 +55,7 @@ var ReactDOMInput = ReactCompositeComponent.createClass({
var defaultValue = this.props.defaultValue;
return {
checked: this.props.defaultChecked || false,
- value: defaultValue != null && defaultValue !== false ? defaultValue : ''
+ value: defaultValue != null ? defaultValue : ''
commit 9e2d6e904015bb1c31af23190ebc05a41cbe21c6
Author: Paul O’Shannessy <[email protected]>
Date: Thu Oct 3 11:05:42 2013 -0700
yup
diff --git a/src/dom/components/ReactDOMInput.js b/src/dom/components/ReactDOMInput.js
index a569a5e..cfd4982 100644
--- a/src/dom/components/ReactDOMInput.js
+++ b/src/dom/components/ReactDOMInput.js
@zpao
zpao / proposal.md
Last active December 21, 2015 14:48
JSX DOM Conventions proposals

Conventions for React DOM & JSX

There's been a lot of discussion lately around how React should use JSX to describe DOM nodes. Thanks to @piranha for sparking this discussion in facebook/react#269

To summarize the current convention of React DOM nodes such as <div /> and <span />.

  • All React DOM elements expect camelCased versions of attributes.
  • camelCasing is natural in a JavaScript-centric programming paradigm (like React).
  • the camelCasing of DOM matches what you would write for custom components:
  • and
@zpao
zpao / gist:5818982
Last active December 18, 2015 17:29
React 0.3.3 Plans
/** @jsx React.DOM */
var MyComponent = React.createClass({
render: function() {
// Defaults in case the props are undefined. We'll have a solution for this
// soon that is less awkward.
var perMinute = this.props.perMinute || '-';
var perDay = this.props.perDay || '-';
return (
<div>
<h3>Clickouts</h3>