mirror of
https://github.com/status-im/react-native.git
synced 2025-02-24 15:18:10 +00:00
Summary: This is one more step to remove `fbjs` from `react-native-github`. This changes both the internal and external code to use `invariant` from zertosh instead of the copy in fbjs. Reviewed By: yungsters Differential Revision: D13195941 fbshipit-source-id: 73564ca1715110e7da9c7ef56dc57374d61377e0
24 lines
561 B
JavaScript
24 lines
561 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
* @flow
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
const invariant = require('invariant');
|
|
|
|
const ensureComponentIsNative = function(component: any) {
|
|
invariant(
|
|
component && typeof component.setNativeProps === 'function',
|
|
'Touchable child must either be native or forward setNativeProps to a ' +
|
|
'native component',
|
|
);
|
|
};
|
|
|
|
module.exports = ensureComponentIsNative;
|