2016-08-09 56 views
0

下面的代码是我的。

我用的是atom,genie motion。

它甾体抗炎药重复申报 “MyScene” 在〜\ index.android.js:20:7react-native android重复声明

import React, { Component } from 'react'; 
import { AppRegistry, ListView, Text, View } from 'react-native'; 

export default class MyScene extends Component { 
    getDefaultProps() { 
    return { 
     title: 'MyScene' 
    }; 
    } 

    render() { 
    return (
     <View> 
     <Text>Hi! My name is {this.props.title}.</Text> 
     </View> 
    ) 
    } 
} 

//import MyScene from './MyScene'; 

class YoDawgApp extends Component { 
    render() { 
    return (
     <MyScene /> 
    ) 
    } 
} 

AppRegistry.registerComponent('YoDawgApp',() => YoDawgApp); 

回答

0

看来,打包还是看你注释掉import语句。这似乎是我错了,但一个快速的解决可以是:

  1. 在注释掉的代码删除注释掉的代码
  2. 更改“MyScene”从字面上任何东西(其他然后“YoDawgApp”)