0

I just run a simple hello world demo in React.native and something went wrong.

This is code in , it's really easy. I guess there is something wrong with this.render

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

export default class HelloWorldApp extends Component {
  render() {
    return (
        <View>
          <Text>Hello world!</Text>
        </View>
    );
  }
}

This is error info in red background of android simulator:

undefined is not a function (evaluating (http://10.0.2.2:8081/index.delta?platform=android &dev=true&minify=false:3573)

1 Answer 1

1

You're not doing anything wrong. It works fine on iOS and also on Android if you run it in the debugger. The problem appears to be with React Native. I was able to reproduce the issue with RN0.57.8.

Try recreating your project for a specific earlier version of React Native.

E.g.

react-native init --version="0.55.4" MyNewApp

Problems like this sometimes emerge when using the latest version of React Native sadly. I normally work with a version that's been out for a couple of months when starting a new project.

Sign up to request clarification or add additional context in comments.

2 Comments

You're welcome. If have an option to accept my answer, I'd appreciate it. Thanks.
So the error is meaningless? It wastes peoples' time getting confused?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.