2016-01-20 50 views
0

所以我剛開始研究React Native,並開始通過創建一個簡單的IOS & Android應用程序來了解基本知識。直到我嘗試將Android本機日曆添加到我的應用中時,所有這一切似乎都進展順利。有人可以幫助/解釋我要去哪裏嗎?React Native - Android日曆不會加載?

我跟着&完成了我在網上找到的教程:https://github.com/chymtt/ReactNativeCalendarAndroid。但是,當我嘗試運行應用程序時,日曆不會加載。這就是我得到:

enter image description here

我在Chrome中調試它的時候發現了這個錯誤 「警告:本機組件,用於 」CalendarAndroid「 不存在」

我代碼:

'use strict'; 

// External plugins 
var React = require('react-native'); 
var Calendar = require('react-native-calendar-android'); 

var { 
    AppRegistry 
} = React; 

var BothDevices = React.createClass({ 
    render() { 
    return (
     <Calendar 
     width={300} 
     topbarVisible={true} 
     arrowColor="#dafacd" 
     firstDayOfWeek="monday" 
     showDate="all" 
     currentDate={[ "2016/12/01" ]} 
     selectionMode="multiple" 
     selectionColor="#dadafc" 
     selectedDates={[ "2015/11/20", "2015/11/30", 1448745712382 ]} 
     onDateChange={(data) => { 
     console.log(data); 
     }} /> 
    ); 
    } 
}); 

AppRegistry.registerComponent('BothDevices',() => BothDevices); 
+0

這已經解決了,剛掃乾淨的項目,並開始回來了 – TheGarrett

回答