UNPKG

rn-web-cli

Version:

React Native for Web

1 lines 4.45 kB
{"version":3,"sources":["node_modules\\react-dom\\lib\\findDOMNode.js"],"names":["_prodInvariant","require","ReactCurrentOwner","ReactDOMComponentTree","ReactInstanceMap","getHostComponentFromComposite","invariant","warning","findDOMNode","componentOrElement","process","env","NODE_ENV","owner","current","_warnedAboutRefsInRender","getName","nodeType","inst","get","getNodeFromInstance","render","Object","keys","module","exports"],"mappings":";;;;;;;;;;AAUA;;AAEA,GAAIA,gBAAiBC,QAAQ,sBAAR,CAArB;;AAEA,GAAIC,mBAAoBD,QAAQ,6BAAR,CAAxB;AACA,GAAIE,uBAAwBF,QAAQ,yBAAR,CAA5B;AACA,GAAIG,kBAAmBH,QAAQ,oBAAR,CAAvB;;AAEA,GAAII,+BAAgCJ,QAAQ,iCAAR,CAApC;AACA,GAAIK,WAAYL,QAAQ,oBAAR,CAAhB;AACA,GAAIM,SAAUN,QAAQ,kBAAR,CAAd;;;;;;;;;;AAUA,QAASO,YAAT,CAAqBC,kBAArB,CAAyC;AACvC,GAAIC,QAAQC,GAAR,CAAYC,QAAZ,GAAyB,YAA7B,CAA2C;AACzC,GAAIC,OAAQX,kBAAkBY,OAA9B;AACA,GAAID,QAAU,IAAd,CAAoB;AAClBH,QAAQC,GAAR,CAAYC,QAAZ,GAAyB,YAAzB,CAAwCL,QAAQM,MAAME,wBAAd,CAAwC,oDAAsD,mEAAtD,CAA4H,oEAA5H,CAAmM,iEAAnM,CAAuQ,6BAA/S,CAA8UF,MAAMG,OAAN,IAAmB,aAAjW,CAAxC,CAA0Z,IAAK,EAA/Z;AACAH,MAAME,wBAAN,CAAiC,IAAjC;AACD;AACF;AACD,GAAIN,oBAAsB,IAA1B,CAAgC;AAC9B,MAAO,KAAP;AACD;AACD,GAAIA,mBAAmBQ,QAAnB,GAAgC,CAApC,CAAuC;AACrC,MAAOR,mBAAP;AACD;;AAED,GAAIS,MAAOd,iBAAiBe,GAAjB,CAAqBV,kBAArB,CAAX;AACA,GAAIS,IAAJ,CAAU;AACRA,KAAOb,8BAA8Ba,IAA9B,CAAP;AACA,MAAOA,MAAOf,sBAAsBiB,mBAAtB,CAA0CF,IAA1C,CAAP,CAAyD,IAAhE;AACD;;AAED,GAAI,MAAOT,oBAAmBY,MAA1B,GAAqC,UAAzC,CAAqD;AACnD,CAAC,KAAD,CAASX,QAAQC,GAAR,CAAYC,QAAZ,GAAyB,YAAzB,CAAwCN,UAAU,KAAV,CAAiB,mDAAjB,CAAxC,CAAgHN,eAAe,IAAf,CAAzH,CAAgJ,IAAK,EAArJ;AACD,CAFD,IAEO;AACL,CAAC,KAAD,CAASU,QAAQC,GAAR,CAAYC,QAAZ,GAAyB,YAAzB,CAAwCN,UAAU,KAAV,CAAiB,qEAAjB,CAAwFgB,OAAOC,IAAP,CAAYd,kBAAZ,CAAxF,CAAxC,CAAmKT,eAAe,IAAf,CAAqBsB,OAAOC,IAAP,CAAYd,kBAAZ,CAArB,CAA5K,CAAoO,IAAK,EAAzO;AACD;AACF;;AAEDe,OAAOC,OAAP,CAAiBjB,WAAjB","file":"findDOMNode.js","sourceRoot":"D:/Work/Office/react-native-on-web/cli/tmpl/project","sourcesContent":["/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\nvar _prodInvariant = require('./reactProdInvariant');\n\nvar ReactCurrentOwner = require('react/lib/ReactCurrentOwner');\nvar ReactDOMComponentTree = require('./ReactDOMComponentTree');\nvar ReactInstanceMap = require('./ReactInstanceMap');\n\nvar getHostComponentFromComposite = require('./getHostComponentFromComposite');\nvar invariant = require('fbjs/lib/invariant');\nvar warning = require('fbjs/lib/warning');\n\n/**\n * Returns the DOM node rendered by this element.\n *\n * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.finddomnode\n *\n * @param {ReactComponent|DOMElement} componentOrElement\n * @return {?DOMElement} The root node of this element.\n */\nfunction findDOMNode(componentOrElement) {\n if (process.env.NODE_ENV !== 'production') {\n var owner = ReactCurrentOwner.current;\n if (owner !== null) {\n process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;\n owner._warnedAboutRefsInRender = true;\n }\n }\n if (componentOrElement == null) {\n return null;\n }\n if (componentOrElement.nodeType === 1) {\n return componentOrElement;\n }\n\n var inst = ReactInstanceMap.get(componentOrElement);\n if (inst) {\n inst = getHostComponentFromComposite(inst);\n return inst ? ReactDOMComponentTree.getNodeFromInstance(inst) : null;\n }\n\n if (typeof componentOrElement.render === 'function') {\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : _prodInvariant('44') : void 0;\n } else {\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : _prodInvariant('45', Object.keys(componentOrElement)) : void 0;\n }\n}\n\nmodule.exports = findDOMNode;"]}