小编管原秀*_*原秀太的帖子

react-native无法读取null的属性"绑定"

我试图运行一个反应本机模拟器.

但是,这个错误在模拟器中出现了:

Failed to load bundle(http://localhost:8081/index.bundle?
platform=ios&dev=true&minify=false) 
with error:(/Users/sugawarasyuta/Desktop/albums/index.js:
Cannot read property 'bindings' of null(null))
Run Code Online (Sandbox Code Playgroud)

我仔细检查了我的代码语法.但我觉得这不是那个.你知道如何解决这个错误吗?

这是我的文件:

index.js

import React from 'react';
import { AppRegistry,View } from 'react-native';
import Header from './src/components/header';
import AlbumList from './src/components/AlbumList';


//Create a component
const App = () => (
<View>
<Header headerText= {'albums'} />
<AlbumList />
</View>
);

AppRegistry.registerComponent('albums', () => App );
Run Code Online (Sandbox Code Playgroud)

AlbumList.js

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

class AlbumList extends Component {

componentWillMount(){
    axios.get('https://rallycoding.herokuapp.com/api/music_albums')
    .then(response …
Run Code Online (Sandbox Code Playgroud)

react-native

21
推荐指数
2
解决办法
2万
查看次数

标签 统计

react-native ×1