UNPKG

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