subject
Computers and Technology, 21.06.2021 16:30 245cat

Very noob React problem and question. So I can log what I'm trying to log here and I get what I want in the console. I'm trying to simply add the stated 'peopleFinallyShowUp' variable that you see. What I have no is wrong of course but I've tried so many things. I get the error Error: Objects are not valid as a React child (found: object with keys {name, height, mass, hair_color, skin_color, eye_color, birth_year, gender, homeworld, films, species, vehicles, starships, created, edited, url}). If you meant to render a collection of children, use an array instead. I have tried creating the state as an array with passed in props. I only want to pass peopleFinallyShowUp and have it render in my app. It consoles just fine, there's simply something restricting me from putting it here between the tags.
import React, { Component } from 'react';
import logo from './logo. svg';
import './App. css';
class App extends Component {
constructor(){
super()
this. state = {
jedi: []
}
}
componentDidMount(){
fetch('https://swapi. co/api/people/1/?format=json').then (response => {
return response. json()})
.then(data => {
// Work with JSON data here
this. setState({jedi: data });
}).catch(err => {
console. log(err)
// Do something for an error here
});
};
render() {
return (

Welcome to React

{this. state. jedi}

);
}
}
export default App;

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 05:30
Sally is editing her science report about living things. she needs to copy a paragraph from her original report. order the steps sally needs to do to copy the text to her new document.
Answers: 1
question
Computers and Technology, 23.06.2019 10:00
Whats three fourths of 15(this is supposed to be in math but i clicked too fast)
Answers: 1
question
Computers and Technology, 25.06.2019 03:00
Match the categories in the first column with examples in the second column. 1. good for watching movies 2. maximum power with small size 3. older style mobile devices that may or may not have internet connectivity tablet computer a.)pda b.)smart phone c.)tablet computer
Answers: 1
question
Computers and Technology, 25.06.2019 05:10
Create a console project in c#. 1. create an interface "imyinterface.cs" - add a method "string imessage()" 2. create a class named "c1.cs" - add 4 private data members, create property for each data member double loanamnout=0.0; double years=0.0; double interests=0.0; double interestrate=0.0; 3. - add a constructor with parameters to assign values to loanamnout, years, interestrate with values that user entered. 4. - add one method “payinterests()” to return the interests interests = loanamnout * interestrate * years 5. - inheritate "imyinterface", implement the method " imessage()", return string "be ready! ” 6. in program.cs, have users to enter loanamnout, years, interestrate. - call method payinterests() to display total interests. - call imessage() to display "be ready! ”
Answers: 3
You know the right answer?
Very noob React problem and question. So I can log what I'm trying to log here and I get what I want...
Questions
question
Social Studies, 07.10.2019 00:30
question
History, 07.10.2019 00:30
question
Health, 07.10.2019 00:30
Questions on the website: 13722361