Day 52
March 6th, 2018
Hello! At the React course by Wes Bos I learned some more about components.
Render() determines what HTML elements we render out to the page. First we need to import react, as well as the render method, which is used to mount the app on a HTML file.
import React from 'react';
import{ render } from 'react-dom';
class StorePicker extends React.Component {
render() {
return <p>Hello!</p>
}
}
We can mount the react app in an empty div in the HTML file.
The render() method takes two arguments.
• JSX like html
• and mounting point
render(<StorePicker/>, document.querySelector('#main'));
You always need to import react in your components.
At the Web Development Bootcamp I worked some more on Movie API
&apikey=thewdb should be added to the omdbapi
To parse an object
var results = JSON.parse(body);
Cheers!