нарушение инварианта: веб-просмотр удален из встроенного ответа. теперь его можно установить и импортировать из response-native-webview. - PullRequest
0 голосов
/ 21 июня 2020

У меня проблема с моим приложением, поддерживающим реакцию! Я получил следующее сообщение об ошибке -> введите описание изображения здесь

Но я правильно использую WebView! Почему это происходит?

**import { WebView } from 'react-native-webview';**
const source = {
    html: `
        <html>
            <head>
                <meta name="viewport" content="width=device-width, initial-scale=1.0">
                <meta charset="utf-8">
            </head>
            <body>
                <p id="mainText" style="position: fixed; top: 0; left: 0; width: 100%; text-align: justify; padding-bottom: 30px; color: #fff; font-size: 16px;
                 font-family: Arial, sans-serif; background-color: transparent;">
                    ${this.props.children}
                </p>
            </body>
        </html>
    `,
}

...

 <WebView
     ref={r => (this.webref = r)}
     javaScriptEnabled={true}
     onLoadEnd={() => this.webref.injectJavaScript(this.state.script)}
     showsVerticalScrollIndicator={false}
     onMessage={event => {
         this.setState({
             height: event.nativeEvent.data
         })
     }}
     source={source}
     useWebKit={true}/>

пакет. json:

"dependencies": {
"@dooboo-ui/native-switch-toggle": "^0.7.0",
"@haskkor/react-native-pincode": "git+https://git@github.com/trustee-wallet/react-native-pincode",
"@react-native-community/async-storage": "^1.7.1",
"@react-native-community/blur": "^3.4.1",
"@react-native-community/masked-view": "^0.1.5",
"@react-native-community/netinfo": "4.1.3",
"@tradle/react-native-http": "^2.0.1",
"assert": "^1.5.0",
"axios": "^0.19.0",
"babel-preset-react-native": "4.0.1",
"babel-preset-stage-2": "6.24.1",
"bip21": "^2.0.3",
"bip32": "^2.0.5",
"bip39": "^3.0.2",
"bip44-constants": "^8.0.23",
"bitcoinjs-lib": "^5.1.10",
"bn.js": "^5.1.2",
"browserify-zlib": "^0.2.0",
"buffer": "^5.4.3",
"card-validator": "^6.2.0",
"console-browserify": "^1.2.0",
"constants-browserify": "^1.0.0",
"cipher-base": "^1.0.4",
"dns.js": "^1.0.1",
"domain-browser": "^1.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-config-standard": "^14.1.1",
"eth-lib": "^0.1.29",
"eth-url-parser": "^1.0.3",
"ethereumjs-util": "^7.0.2",
"ethjs-provider-http": "^0.1.6",
"ethjs-query": "^0.3.8",
"events": "^3.1.0",
"fast-luhn": "^1.1.1",
"https-browserify": "0.0.1",
"i18n-js": "^3.5.1",
"inherits": "^2.0.1",
"jetifier": "^1.6.5",
"lodash": "^4.17.15",
"lottie-ios": "3.1.3",
"lottie-react-native": "^3.3.2",
"md5": "^2.2.1",
"metro-config": "^0.59.0",
"moment": "^2.24.0",
"node-libs-browser": "^2.2.1",
"path-browserify": "0.0.0",
"process": "^0.11.10",
"punycode": "^2.1.1",
"querystring-es3": "^0.2.1",
"react": "16.9.0",
"react-native": "0.61.5",
"react-native-awesome-card-io": "^0.8.2",
"react-native-background-fetch": "^3.0.3",
"react-native-background-timer": "^2.1.1",
"react-native-blocksoft-random": "git+https://git@github.com/trustee-wallet/react-native-blocksoft-random",
"react-native-bip39": "^2.3.0",
"react-native-blur-overlay": "^1.0.7",
"react-native-camera": "git+https://git@github.com/react-native-community/react-native-camera.git",
"react-native-crypto": "git+https://github.com/trustee-wallet/react-native-crypto",
"react-native-dash": "0.0.11",
"react-native-device-info": "^5.5.4",
"react-native-error-boundary": "^1.1.0",
"react-native-exception-handler": "^2.10.8",
"react-native-exit-app": "^1.1.0",
"react-native-fbsdk": "^1.1.2",
"react-native-firebase": "5.6.0",
"react-native-fs": "^2.16.2",
"react-native-flurry-sdk": "5.5.0",
"react-native-gesture-handler": "^1.6.1",
"react-native-image-picker": "^2.3.1",
"react-native-image-resizer": "^1.2.1",
"react-native-indicators": "^0.17.0",
"react-native-keyboard-aware-view": "0.0.14",
"react-native-keychain": "^6.1.1",
"react-native-level-fs": "^3.0.1",
"react-native-linear-gradient": "^2.5.6",
"react-native-localize": "^1.3.2",
"react-native-masked-text": "^1.13.0",
"react-native-material-textfield": "0.12.0",
"react-native-modal": "^11.5.3",
"react-native-navigation-bar-color": "^2.0.1",
"react-native-orientation": "3.1.3",
"react-native-orientation-loading-overlay": "^0.1.6",
"react-native-os": "^1.2.6",
"react-native-paper": "^3.4.0",
"react-native-permissions": "^2.0.9",
"react-native-phone-input": "^0.2.4",
"react-native-qrcode-scanner": "^1.3.1",
"react-native-picker-select": "^7.0.0",
"react-native-popup-menu": "^0.15.7",
"react-native-progress-circle": "^2.1.0",
"react-native-qrcode-svg": "^6.0.1",
"react-native-qrcode-transparent": "^0.2.6",
"react-native-randombytes": "^3.5.3",
"react-native-reanimated": "^1.4.0",
"react-native-root-toast": "^3.2.0",
"react-native-safe-area-context": "^0.6.2",
"react-native-safe-area-view": "^1.0.0",
"react-native-screens": "^2.0.0-alpha.22",
"react-native-shadow": "^1.2.2",
"react-native-share": "^3.3.3",
"react-native-snap-carousel": "^3.8.4",
"react-native-snow": "^0.2.0",
"react-native-sqlite-helper": "1.1.0",
"react-native-sqlite-storage": "^5.0.0",
"react-native-svg": "^12.1.0",
"react-native-svg-transformer": "^0.14.3",
"react-native-swipeable": "^0.6.0",
"react-native-tab-view": "^2.11.0",
"react-native-tcp": "^4.0.0",
"react-native-udp": "^3.1.0",
"react-native-vector-icons": "^6.6.0",
"react-native-version-check": "^3.4.0",
"react-native-walkthrough-tooltip": "^1.1.7",
"react-native-webview": "^8.0.2",
"react-native-wheel-picker": "git+https://git@github.com/trustee-wallet/react-native-wheel-picker",
"react-native-wheel-picker-android": "^2.0.5",
"react-navigation": "4.0.10",
"react-navigation-stack": "1.10.3",
"react-navigation-material-bottom-tabs": "^2.2.12",
"react-redux": "^7.1.3",
"readable-stream": "^1.0.33",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"ripple-lib": "^1.6.0",
"rn-tooltip": "^2.0.0",
"safe-event-emitter": "^1.0.1",
"stream-browserify": "^1.0.0",
"string_decoder": "^1.3.0",
"timers-browserify": "^2.0.11",
"tty-browserify": "0.0.0",
"url": "^0.10.3",
"util": "^0.10.4",
"vm-browserify": "0.0.4",
"web3": "1.2.7" },


"devDependencies": {
"@babel/core": "7.7.7",
"@babel/runtime": "7.7.7",
"@react-native-community/eslint-config": "0.0.5",
"@types/jest": "^25.1.4",
"@types/react": "^16.9.31",
"@types/react-native": "^0.62.1",
"@types/react-redux": "^7.1.7",
"@types/react-test-renderer": "^16.9.2",
"@typescript-eslint/eslint-plugin": "^2.28.0",
"babel-eslint": "^10.1.0",
"babel-cli": "^6.26.0",
"babel-jest": "24.9.0",
"babel-preset-es2015": "6.24.1",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.9.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-import": "^2.20.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-sql": "^1.1.1",
"eslint-plugin-standard": "^4.0.1",
"jest": "24.9.0",
"metro-react-native-babel-preset": "0.56.3",
"react-test-renderer": "16.9.0",
"rn-nodeify": "github:tradle/rn-nodeify",
"typescript": "^3.8.3" }

Может еще какой модуль использует старую версию WebView? Не понимаю, все перепробовал! ((Буду благодарен за любой совет !! Может мне кто-нибудь поможет?

...