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 | ;
|
12 |
|
13 | var shallowEqual = require('fbjs/lib/shallowEqual');
|
14 |
|
15 | /**
|
16 | * Does a shallow comparison for props and state.
|
17 | * See ReactComponentWithPureRenderMixin
|
18 | * See also https://facebook.github.io/react/docs/shallow-compare.html
|
19 | */
|
20 | function shallowCompare(instance, nextProps, nextState) {
|
21 | return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);
|
22 | }
|
23 |
|
24 | module.exports = shallowCompare; |
\ | No newline at end of file |