UNPKG

1.54 kBJavaScriptView Raw
1/**
2 * Copyright (c) 2013-present, Facebook, Inc.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 */
8
9'use strict';
10
11var LinkedStateMixin = require('./LinkedStateMixin');
12var React = require('./React');
13var ReactAddonsDOMDependencies = require('./ReactAddonsDOMDependencies');
14var ReactComponentWithPureRenderMixin = require('./ReactComponentWithPureRenderMixin');
15var ReactCSSTransitionGroup = require('./ReactCSSTransitionGroup');
16var ReactFragment = require('./ReactFragment');
17var ReactTransitionGroup = require('./ReactTransitionGroup');
18
19var shallowCompare = require('./shallowCompare');
20var update = require('./update');
21
22React.addons = {
23 CSSTransitionGroup: ReactCSSTransitionGroup,
24 LinkedStateMixin: LinkedStateMixin,
25 PureRenderMixin: ReactComponentWithPureRenderMixin,
26 TransitionGroup: ReactTransitionGroup,
27
28 createFragment: ReactFragment.create,
29 shallowCompare: shallowCompare,
30 update: update
31};
32
33if (process.env.NODE_ENV !== 'production') {
34 // For the UMD build we get these lazily from the global since they're tied
35 // to the DOM renderer and it hasn't loaded yet.
36 Object.defineProperty(React.addons, 'Perf', {
37 enumerable: true,
38 get: function () {
39 return ReactAddonsDOMDependencies.getReactPerf();
40 }
41 });
42 Object.defineProperty(React.addons, 'TestUtils', {
43 enumerable: true,
44 get: function () {
45 return ReactAddonsDOMDependencies.getReactTestUtils();
46 }
47 });
48}
49
50module.exports = React;
\No newline at end of file