Day 52

in #code7 years ago

March 6th, 2018

<p dir="auto">Hello! At the React course by Wes Bos I learned some more about components.<br /> 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. <pre><code> import React from 'react'; import{ render } from 'react-dom'; class StorePicker extends React.Component { render() { return <p>Hello!</p> } } <p dir="auto">We can mount the react app in an empty div in the HTML file.<br /> The render() method takes two arguments.<br /> • JSX like html<br /> • and mounting point <pre><code> render(<StorePicker/>, document.querySelector('#main')); <p dir="auto">You always need to import react in your components. <p dir="auto">At the Web Development Bootcamp I worked some more on Movie API<br /> &apikey=thewdb should be added to the omdbapi<br /> To parse an object <pre><code> var results = JSON.parse(body); <p dir="auto">Cheers!