我正在尝试在我的应用程序中实现React-Navigation。我去了reactnavigation.org并尝试了他们的教程,但我遇到了一个问题:
Element type is invalid, expected string or class/function got: object.
我看不到问题,因为我从他们的教程中复制了代码,不管怎样,这是我的代码:
索引:
import React from 'react';
import { StackNavigator } from 'react-navigation';
const Stylelist =
我想做的是创建一个TouchableOpacity,然后在我的程序中到处使用它。我在处理新闻事件时遇到了一个问题。我在其他类中导入了TouchableOpacity,并希望在那里处理onPress事件。但是我的代码不是working.There,导入也没有问题。下面是我导入TouchableOpacity组件的类
import React, {Component} from 'react';
import {Text,View,Alert} from 'react-native';
import MyButton from './MyButton'
//I was not able to open the gallery by using the react native image picker
import React, { useState } from 'react'
import { launchCamera, launchImageLibrary } from 'react-native-image-picker'
import * as ImagePicker from 'react-native-image-picker'
import { StyleSheet,Text
我的btn组件有问题,我使用的是react本机-线性-梯度库.
btn.js
import React,{ Component } from 'react';
import {View,Text,StyleSheet, TouchableOpacity} from 'react-native';
import {Button,Item} from 'native-base';
import LinearGradient from 'react-native-linear-gradient';
class GradientBtn