Posts

Showing posts with the label native

React Native display simple Json Data

React Native display simple Json Data I am trying to create a simple page, in which I want to display the data i get from the Json file. Unfortunately I get "Invariant Violation: Objects are not valid as a React child (found: object with keys {ts, trend, baro, temp, hum, wind, rain, et, forecast, sun}). If you meant to render a collection of children, use an array instead." So it loads the Json but I cant display the data. If tried various methods, but couldnt solve it. App.js import React from 'react' import { AppRegistry, StyleSheet, FlatList, Text, View, Alert, ActivityIndicator, Platform} from 'react-native' export default class Planner extends React.Component { constructor(props) { super(props); this.state = { isLoading: true } } componentDidMount() { return fetch('url') .then((response) => response.json()) .then((responseJson) => { this.setState({ isLoading: false, ...