#react-native
#react-native
Вопрос:
Я на самом деле не знаю, почему это происходит. У меня есть некоторые другие предупреждения, например: «Ошибка: предупреждение: AsyncStorage был извлечен из ядра react-native и будет удален в будущем выпуске. Теперь ее можно установить и импортировать из»Я делюсь скриншотом журнала ошибок и файлом package.json ниже. Кто-нибудь может мне помочь выбраться?
{
"name": "eonbazar",
"displayName": "eonbazar",
"description": "MStore Pro - Complete React Native template for e-commerce",
"author": "InpireUI",
"version": "1.0.0",
"private": true,
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"setup": "./scripts/setup.sh",
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"eject": "expo eject",
"postinstall": "patch-package"
},
"dependencies": {
"@callstack/react-theme-provider": "^2.1.0",
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"@material-ui/styles": "^4.10.0",
"@react-native-community/async-storage": "^1.12.1",
"@react-native-community/masked-view": "0.1.10",
"@react-native-community/viewpager": "4.1.6",
"@react-native-firebase/app": "^8.4.6",
"@unimodules/core": "^5.5.1",
"@unimodules/react-native-adapter": "~5.6.0",
"api-ecommerce": "^0.0.36",
"axios": "^0.20.0",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"babel-preset-env": "^1.7.0",
"base-64": "^1.0.0",
"by": "^0.2.3",
"core-js": "^3.6.5",
"create-react-context": "^0.3.0",
"css-select": "^3.1.0",
"currency-formatter": "^1.5.6",
"eslint": "^7.11.0",
"eslint-config-prettier": "^6.13.0",
"expo": "^39.0.3",
"expo-ads-admob": "~8.3.0",
"expo-ads-facebook": "~8.4.1",
"expo-analytics": "^1.0.16",
"expo-asset": "~8.2.0",
"expo-av": "~8.6.0",
"expo-constants": "~9.2.0",
"expo-facebook": "~9.0.0",
"expo-font": "~8.3.0",
"expo-google-app-auth": "^8.1.3",
"expo-google-sign-in": "~8.3.0",
"expo-linear-gradient": "~8.3.1",
"expo-localization": "~9.0.0",
"expo-web-browser": "~8.5.0",
"firebase": "7.24.0",
"grpc": "^1.24.3",
"html-entities": "^1.3.1",
"lodash": "^4.17.20",
"moment": "2.29.1",
"monet": "0.9.1",
"native-base": "^2.13.14",
"oauth-1.0a": "2.2.6",
"parse": "github:parse-community/Parse-SDK-JS#master",
"patch-package": "^6.2.2",
"path": "^0.12.7",
"postinstall-postinstall": "^2.1.0",
"prop-types": "^15.7.2",
"react": "^16.14.0",
"react-dom": "16.14.0",
"react-instantsearch": "^6.8.1",
"react-instantsearch-dom": "^6.8.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-39.0.3.tar.gz",
"react-native-animatable": "1.3.3",
"react-native-app-intro-slider": "4.0.4",
"react-native-clean-form": "^0.5.0",
"react-native-collapsible": "1.5.3",
"react-native-confirmation-code-field": "^6.5.0",
"react-native-country-picker-modal": "^2.0.0",
"react-native-credit-card-input": "^0.4.1",
"react-native-dev-menu": "^4.0.2",
"react-native-drawer": "git https://github.com/luyx2412/react-native-drawer.git",
"react-native-expandable-section-flatlist": "^1.2.2",
"react-native-fluid-slider": "^1.0.2",
"react-native-gesture-handler": "~1.8.0",
"react-native-keyboard-aware-scroll-view": "^0.9.3",
"react-native-keyboard-aware-scrollview": "^2.1.0",
"react-native-localization": "^2.1.6",
"react-native-masked-text": "1.13.0",
"react-native-modalbox": "2.0.2",
"react-native-paper": "4.2.0",
"react-native-parallax": "^0.3.0",
"react-native-radio-buttons": "^1.0.0",
"react-native-reanimated": "~1.13.1",
"react-native-render-html": "4.2.4",
"react-native-safe-area-view": "^1.1.1",
"react-native-screens": "~2.11.0",
"react-native-scrollable-tab-view": "^1.0.0",
"react-native-side-menu": "^1.1.3",
"react-native-snap-carousel": "^3.9.1",
"react-native-star-rating": "^1.1.0",
"react-native-swipe-list-view": "3.2.4",
"react-native-swiper": "^1.6.0",
"react-native-tab-view": "^2.15.2",
"react-native-web": "~0.14.2",
"react-native-webview": "^10.9.2",
"react-native-windows": "^0.63.5",
"react-navigation": "^4.4.2",
"react-navigation-header-buttons": "6.0.0",
"react-navigation-props-mapper": "^1.0.4",
"react-navigation-stack": "^2.8.4",
"react-navigation-tabs": "^2.9.2",
"react-proxy": "^1.1.8",
"react-redux": "7.2.1",
"reactotron-react-js": "^3.3.7",
"redux": "^4.0.5",
"redux-actions": "2.6.5",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.3.0",
"required": "^1.0.0",
"reselect": "4.0.0",
"sentry-expo": "^3.0.2",
"styled-components": "^5.2.0",
"tcomb-form-native": "^0.6.20",
"urijs": "1.19.2",
"url": "^0.11.0",
"url-parse": "1.4.7",
"util": "0.12.3",
"uuid": "8.3.1",
"validate.js": "^0.13.1",
"wpapi": "^1.2.1"
},
"devDependencies": {
"@babel/types": "^7.12.1",
"babel-jest": "26.5.2",
"babel-plugin-transform-remove-console": "^6.9.4",
"babel-preset-expo": "^8.3.0",
"babel-preset-react-native": "4.0.1",
"jest": "26.5.3",
"reactotron-react-native": "5.0.0",
"reactotron-redux": "^3.1.3"
},
"keywords": [
"ecommerce"
],
"license": "ISC"
}
Ответ №1:
Ошибка вводит в заблуждение без дополнительного кода или информации, но у меня была похожая проблема. Ваша проблема может заключаться в том, что способ withTheme
импортируется @callstack / из react-theme-provider. Просматривая документы, я добился некоторого успеха в изменении способа извлечения функции из пакета. Если вы импортируете ее следующим образом:
import { withTheme } from "@callstack/react-theme-provider";
Попробуйте вместо этого выполнить следующее:
import { createTheming } from '@callstack/react-theme-provider';
const { withTheme } = createTheming();
Если у вас есть defaultTheme
, вы можете передать его в качестве аргумента, например createTheming(defaultTheme)
;