You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
2.9 KiB

{"ast":null,"code":"'use strict';\nfunction setAndForwardRef(_ref) {\n var getForwardedRef = _ref.getForwardedRef,\n setLocalRef = _ref.setLocalRef;\n return function forwardRef(ref) {\n var forwardedRef = getForwardedRef();\n setLocalRef(ref);\n if (typeof forwardedRef === 'function') {\n forwardedRef(ref);\n } else if (typeof forwardedRef === 'object' && forwardedRef != null) {\n forwardedRef.current = ref;\n }\n };\n}\nexport default setAndForwardRef;","map":{"version":3,"names":["setAndForwardRef","_ref","getForwardedRef","setLocalRef","forwardRef","ref","forwardedRef","current"],"sources":["/Users/mathildejean/Documents/BUT/LaSuperMeteo/LaSuperMeteo/iut-expo-starter/node_modules/react-native-web/dist/vendor/react-native/Utilities/setAndForwardRef.js"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n * \n */\n'use strict';\n\n/**\n * This is a helper function for when a component needs to be able to forward a ref\n * to a child component, but still needs to have access to that component as part of\n * its implementation.\n *\n * Its main use case is in wrappers for native components.\n *\n * Usage:\n *\n * class MyView extends React.Component {\n * _nativeRef = null;\n *\n * _setNativeRef = setAndForwardRef({\n * getForwardedRef: () => this.props.forwardedRef,\n * setLocalRef: ref => {\n * this._nativeRef = ref;\n * },\n * });\n *\n * render() {\n * return <View ref={this._setNativeRef} />;\n * }\n * }\n *\n * const MyViewWithRef = React.forwardRef((props, ref) => (\n * <MyView {...props} forwardedRef={ref} />\n * ));\n *\n * module.exports = MyViewWithRef;\n */\nfunction setAndForwardRef(_ref) {\n var getForwardedRef = _ref.getForwardedRef,\n setLocalRef = _ref.setLocalRef;\n return function forwardRef(ref) {\n var forwardedRef = getForwardedRef();\n setLocalRef(ref); // Forward to user ref prop (if one has been specified)\n\n if (typeof forwardedRef === 'function') {\n // Handle function-based refs. String-based refs are handled as functions.\n forwardedRef(ref);\n } else if (typeof forwardedRef === 'object' && forwardedRef != null) {\n // Handle createRef-based refs\n forwardedRef.current = ref;\n }\n };\n}\n\nexport default setAndForwardRef;"],"mappings":"AASA,YAAY;AAgCZ,SAASA,gBAAgB,CAACC,IAAI,EAAE;EAC9B,IAAIC,eAAe,GAAGD,IAAI,CAACC,eAAe;IACtCC,WAAW,GAAGF,IAAI,CAACE,WAAW;EAClC,OAAO,SAASC,UAAU,CAACC,GAAG,EAAE;IAC9B,IAAIC,YAAY,GAAGJ,eAAe,EAAE;IACpCC,WAAW,CAACE,GAAG,CAAC;IAEhB,IAAI,OAAOC,YAAY,KAAK,UAAU,EAAE;MAEtCA,YAAY,CAACD,GAAG,CAAC;IACnB,CAAC,MAAM,IAAI,OAAOC,YAAY,KAAK,QAAQ,IAAIA,YAAY,IAAI,IAAI,EAAE;MAEnEA,YAAY,CAACC,OAAO,GAAGF,GAAG;IAC5B;EACF,CAAC;AACH;AAEA,eAAeL,gBAAgB"},"metadata":{},"sourceType":"module","externalDependencies":[]}