Skip to content

Commit

Permalink
Day_4
Browse files Browse the repository at this point in the history
  • Loading branch information
Asabeneh committed Oct 3, 2020
1 parent af7e7df commit c2e668e
Show file tree
Hide file tree
Showing 18 changed files with 11,661 additions and 7 deletions.
6 changes: 3 additions & 3 deletions 02_Day_Introduction_to_React/02_introduction_to_react.md
Original file line number Diff line number Diff line change
Expand Up @@ -855,8 +855,8 @@ In this section we only inject only strings
const welcome = 'Welcome to 30 Days Of React'
const title = 'Getting Started React'
const subtitle = 'JavaScript Library'
const authorFirstName = 'Asabeneh'
const authorLastName = 'Yetayeh'
const firstName = 'Asabeneh'
const lastName = 'Yetayeh'
const date = 'Oct 2, 2020'

// JSX element, header
Expand All @@ -869,7 +869,7 @@ const header = (
<h2>{title}</h2>
<h3>{subtitle}</h3>
<p>
Instructor: {authorFirstName} {authorLastName}
Instructor: {firstName} {lastName}
</p>
<small>Date: {date}</small>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 03_Day_Setting_Up/03_day_setting_up.md
Original file line number Diff line number Diff line change
Expand Up @@ -746,4 +746,4 @@ The boilerplate code can be found [here](../03/../03_Day_Setting_Up/30-days-of-r
![News Letter](../images/news_letter_design.png)

🎉 CONGRATULATIONS ! 🎉
[<< Day 2](../02_Day_Introduction_to_React/02_introduction_to_react.md) | [Day 4 >>]()
[<< Day 2](../02_Day_Introduction_to_React/02_introduction_to_react.md) | [Day 4 >>](../04_Day_Components/04_components.md)
21 changes: 18 additions & 3 deletions 03_Day_Setting_Up/30-days-of-react_boilerplate/src/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
// index.js
import React from 'react';
import ReactDOM from 'react-dom';
import React from 'react'
import ReactDOM from 'react-dom'
// To get the root element from the HTML document
import asabenehImage from './images/asabeneh.jpg';
import asabenehImage from './images/asabeneh.jpg'

// to import the doSomeMath from the math.js with or without extension
import doSomeMath from './math.js'

// to import the other modules
// since these modules were not exported as default we have to desctructure
import { addTwo, multiply, subtract } from './math.js'

import * as everything from './math.js'
console.log(addTwo(5, 5))
console.log(doSomeMath.addTwo(5, 5))
console.log(everything)
// JSX element, header


// JSX element, header
const welcome = 'Welcome to 30 Days Of React'
const title = 'Getting Started React'
Expand Down
12 changes: 12 additions & 0 deletions 03_Day_Setting_Up/30-days-of-react_boilerplate/src/math.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// math.js
export const addTwo = (a, b) => a + b
export const multiply = (a, b) => a * b
export const subtract = (a, b) => a - b

export default(function doSomeMath() {
return {
addTwo,
multiply,
subtract,
}
})()
Loading

0 comments on commit c2e668e

Please sign in to comment.