LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code

  
  
  
  
    
JS
/*
In today's lab we will get an introduction to React.js and learn what it is used for.

We will set up our development environment, write our first component and submit it to Leaflet.
*/

//turn on ES6 transpiling (Babel)

//add the react libraries to our environment
//react, and react-dom
const userName="Bob";
let secondsSinceLogin = 4;

//create a functional component
//make a functional component that says a greeting for a user
const Greeting = props => {
  return(

Greetings {userName}

) } //make a second functional component that says how many days since last login const UserInfo = props => { return(

You have been logged in for {secondsSinceLogin} seconds

) } //create a class-based component //learn to use the render function to compose your two functional classes class Settings extends React.Component{ constructor(props){ super(props); } render(){ return(
) } } //render to the screen //learn to use ReactDOM to render components to the screen ReactDOM.render(, document.querySelector('#app') );
Host Instantly Drag and Drop Website Builder

 

Description

In today's lab we will get an introduction to React.js and learn what it is used for.
Term
Mon, 11/27/2017 - 21:43

Related Codes

Pen ID
Pen ID
Pen ID