scrimba
21 web dev tips for 2021 🎇
Tip 8.2: Helpers Challenge
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

To see this lesson you need to be logged in. Joining Scrimba is free and gives you access to 20+ courses.Sign up
AboutCommentsNotes
Tip 8.2: Helpers Challenge
Expand for more info
components
PriceDisplay.js
run
preview
console
// Creating Helpers

import React from 'react'
import ReactDOM from 'react-dom'
import glob from '../lib/helpers'

const PriceDisplay = () => {
let price = 123.4556

return (
<div className="price-rounder-container">
<h2>Last Transaction</h2>
<div className="price-display">£{glob.normalisePrice(price)}</div>
</div>
)
}

export default PriceDisplay

// Mini Challenge
// In the same way that we created this helper, Can you add a helpers that will help us display the // total price of all 3 the previous transactions in the App Component and the total price of the // prices in the Price Display Component?
Console
/index.html
-7:51