Skip to content

Instantly share code, notes, and snippets.

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.
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.
@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/docs/docs/04-multiple-components.md b/docs/docs/04-multiple-components.md
index 38d1a9c..8295f5d 100644
--- a/docs/docs/04-multiple-components.md
+++ b/docs/docs/04-multiple-components.md
@@ -134,15 +134,16 @@ The situation gets more complicated when the children are shuffled around (as in
When React reconciles the keyed children, it will ensure that any child with `key` will be reordered (instead of clobbered) or destroyed (instead of reused).
-Keys can also be specified as object properties. However it is important to remember that JavaScript does not guarantee the ordering of properties will be preserved. In practice browsers will preserve property order **except** for properties that can be parsed as a 32-bit unsigned integers. Numeric properties will be ordered sequentially and before other properties. If this happens React will render components out of order. This can be avoided by adding a string prefix to the key:
+You can also key children by passing an object. The object keys will
@zpao
zpao / React.createClass.sublime-snippet
Created February 20, 2014 04:32
Simple snippet to expand into a basic React component using JSX
<snippet>
<content><![CDATA[
var ${1:component} = React.createClass({
render: function() {
return (
${2:<div />}
);
}
});
]]></content>

Things I would say if somebody asked me about browserify

It works fine.

I don't want to murder somebody every time I work with browserify.

There are other things like it but everybody else is using browserify so we do too.

@substack is wicked smart, it must do the right thing.

--- build/react-with-addons.js 2014-03-18 11:00:26.000000000 -0700
+++ build/react-with-addons.old.js 2014-03-18 11:00:08.000000000 -0700
@@ -58,45 +58,45 @@
};
if ('production' !== 'development') {
React.addons.TestUtils = _require(8);
}
module.exports = React;
},
function (module, exports) {
@zpao
zpao / gist:9677728
Last active August 29, 2015 13:57
My code from https://news.ycombinator.com/item?id=7426312 but in a sane format
/* @jsx m.dom */
function m(type, props, children) {
// assuming m() looks something like this.
return {
type: type,
props: props,
children: children
};
}
@zpao
zpao / app.js
Created March 30, 2014 02:19
express-react-views. All server generated, no client mount or anything.
// normal express stuff
app.set('view engine', 'jsx');
app.engine('jsx', require('express-react-views').__express);
// the rest of it
diff --git a/src/browser/ui/ReactDefaultInjection.js b/src/browser/ui/ReactDefaultInjection.js
index c290403..8a79942 100644
--- a/src/browser/ui/ReactDefaultInjection.js
+++ b/src/browser/ui/ReactDefaultInjection.js
@@ -49,7 +49,7 @@ var ServerReactRootIndex = require('ServerReactRootIndex');
var SimpleEventPlugin = require('SimpleEventPlugin');
var BeforeInputEventPlugin = require('BeforeInputEventPlugin');
-var ReactDefaultBatchingStrategy = require('ReactDefaultBatchingStrategy');
+var ReactRAFBatchingStrategy = require('ReactRAFBatchingStrategy');