¿Hay alguna forma de ejecutar un script desde un cdn en react-native?
Por ejemplo en ReactJS:
//index.html <script type="text/javascript" src="https://js.xendit.co/v1/xendit.min.js" ></script> //react component file const Xendit = window.Xendit; const Component = ({card_number}) => { const[cardNumberValidated, setCardNumberValidated] = useState(false); useEffect(() => { const isValidated = Xendit.card.validate(card_number); setCardNumberValidated(isValidated) },[]) ... }Intenté descargar el archivo y guardarlo localmente, pero no funciona
saved file Xendit.min.js //import import Xendit from '@myUtils/Xendit.min'; import {KEY} from '@myUtils/XenditUtils'; //call it Xendit.setPublishableKey(KEY) //it returns Xendit.default.setPublishableKey is not a functionUsar xendit-js-node
... import Xendit from 'xendit-js-node'; ... Xendit.setPublishableKey('xnd_public_development_OYqIfOUth+GowsY6LeJOHzLCZtSj84J9kXDn+Rxj/mbf/LCoCQdxgA=='); ... Xendit.card.createAuthentication(threeDSData, this._tokenResponseHandler); ... //etc.Hay un ejemplo oficial de la aplicación React Native: https://github.com/xendit/xendit-react-example