PaypalButton(由ScriptLoader创建)文本字符串必须在<Text>组件内呈现

时间:2019-08-05 15:21:30

标签: react-native paypal react-native-android create-react-native-app

我遵循了下面的npm链接说明,但是它不能正常工作,有人可以帮我这个忙。 https://www.npmjs.com/package/react-paypal-express-checkout/v/1.0.5

得到以下错误 不变违规:不变违规:文本字符串必须在组件内呈现。

This error is located at:
in div (created by PaypalButton)
in PaypalButton (created by ScriptLoader)
in ScriptLoader (at Cart.js:20)
in RCTView (at View.js:45)
in View (at Cart.js:19)
in Cart (at SceneView.js:9)
in SceneView (at createTabNavigator.js:39)
in RCTView (at View.js:45)
in View (at ResourceSavingScene.js:37)
in RCTView (at View.js:45)
in View (at ResourceSavingScene.js:26)
in ResourceSavingScene (at createBottomTabNavigator.js:121)
in RCTView (at View.js:45)
in View (at screens.native.js:83)
in ScreenContainer (at createBottomTabNavigator.js:111)
in RCTView (at View.js:45)
in View (at createBottomTabNavigator.js:110)
in TabNavigationView (at createTabNavigator.js:197)
in NavigationView (at createNavigator.js:61)
in Navigator (at createAppContainer.js:429)
in NavigationContainer (at App.js:14)
in RCTView (at View.js:45)
in View (at App.js:12)
in App (at withExpoRoot.js:20)
in RootErrorBoundary (at withExpoRoot.js:19)
in ExpoRootComponent (at renderApplication.js:35)
in RCTView (at View.js:45)
in View (at AppContainer.js:98)
in RCTView (at View.js:45)
in View (at AppContainer.js:115)
in AppContainer (at renderApplication.js:34)

import PaypalExpressBtn from 'react-paypal-express-checkout';

export default class MyApp extends React.Component {
  render() {
     const client = {
        sandbox:    'YOUR-SANDBOX-APP-ID',
        production: 'YOUR-PRODUCTION-APP-ID',
     }
    return (
        <PaypalExpressBtn client={client} currency={'USD'} total={1.00}/>
    );
 }
   }

0 个答案:

没有答案