小编Fre*_*der的帖子

React Native Typescript babel-plugin-module-resolver 错误:找不到模块或其相应的类型声明

我可以毫无问题地使用带有 Javascript 的模块解析器。实际上我可以将它与 Typescript 一起使用,在运行时没有问题,但在开发部分我找不到Cannot find module or its corresponding type declerations问题的解决方案。我正在寻找答案,我哪一部分做错了?

以下是文件:

.babelrc

{
  "presets": ["module:metro-react-native-babel-preset"],
  "plugins": [
    [
      "module-resolver",
      {
        "root": ["./src"],
        "alias": [
          { "@shared-components": "./shared/components" },
          { "@shared-constants": "./shared/constants" },
          { "@shared-theme": "./shared/theme" },
          { "@font-size": "./shared/theme/font-size" },
          { "@api": "./services/api/index" },
          { "@fonts": "./shared/theme/fonts/index" },
          { "@colors": "./shared/theme/colors" },
          { "@theme": "./shared/theme/index" },
          { "@services": "./services" },
          { "@screens": "./screens" },
          { "@utils": "./utils/" },
          { "@assets": "./assets/" }
        ],
        "extensions": [".js", ".jsx", …
Run Code Online (Sandbox Code Playgroud)

javascript typescript reactjs react-native

4
推荐指数
1
解决办法
9752
查看次数

React Native Modal:透明背景和布局问题

我正在使用React Native Modal,我希望Modal的背景是透明的,并且我希望Modal显示代表屏幕

如何达到同样的要求,我哪里出错了?

下面是相同的代码,请看一下:

import React, { Component } from 'react'
import { Modal, View, Text, Dimensions, Platform, TouchableOpacity, Alert, StyleSheet, Button } from 'react-native'
import Icon from 'react-native-vector-icons/Entypo'

const windowWidth = Dimensions.get('window').width;
const windowHeight = Dimensions.get('window').height;

export class MyComponent extends Component {

    render = () => {
    const message = 'Do you want to upload the video now or wait until you are connected to wi-fi?'
    return (
      <Modal
        animationType='slide'
        transparent={true}
        style={{backgroundColor: 'black'}}
      >
        <View style={styles.content}>
          <View style={styles.closeBtn}> …
Run Code Online (Sandbox Code Playgroud)

react-native react-native-modal

2
推荐指数
1
解决办法
9695
查看次数

React Native Firebase 推送通知崩溃报告问题

我正在使用 React Native 构建一个应用程序。通过 React Native Firebase,我添加了推送通知功能。当我从退出状态打开推送通知时,应用程序打开并在启动屏幕上挂起一段时间,然后崩溃。

这是来自设备的崩溃报告,用符号表示。老实说,我是编程新手,所以我在解释下面的报告时遇到了困难。我认为 RNSplashScreen 模块或 AppDelegate.m 有问题,但不能确定。

谁能帮助我解释这一点并指出可能的根本原因/在哪里查看?

谢谢!

    Exception Type:  EXC_CRASH (SIGKILL)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Exception Note:  EXC_CORPSE_NOTIFY
    Termination Reason: Namespace SPRINGBOARD, Code 0x8badf00d
    Termination Description: SPRINGBOARD, <RBSTerminateContext| domain:10 code:0x8BADF00D explanation:scene-create watchdog transgression: application<myapp.myapp>:2661 exhausted real (wall clock) time allowance of 59.91 seconds | ProcessVisibility: Foreground | ProcessState: Running | WatchdogEvent: scene-create | WatchdogVisibility: Background | WatchdogCPUStatistics: ( | "Elapsed total CPU time (seconds): 16.580 (user 16.580, system 0.000), 5% CPU", | "Elapsed …
Run Code Online (Sandbox Code Playgroud)

ios react-native

2
推荐指数
1
解决办法
1514
查看次数