$ npm i --save react@16.14.0 react-dom@16.14.0 enzyme enzyme-adapter-react-16 --legacy-peer-deps
- Create .npmrc in root of your app
- Add the following content inside this file
// Get id of element clicked by user | |
$("#color-picker").click(function (event) { | |
// userAnswer = event.target.id; | |
// we need to stop bubbling up on the event or else the target of the event will bubble up to #color-picker | |
event.stopPropagation(); | |
// now we get the target to be the li that was clicked | |
console.log('tcot', targetColorOfText) | |
// console.log(event.target); | |
// use dot syntax to get the style attribute's color property | |
// console.log(event.target.style.color); |
// Constructor function which can be used to create objects containing the properties "raining", "noise", and the "makeNoise()" function | |
function Animal(raining, noise) { | |
this.raining = raining; | |
this.noise = noise; | |
this.makeNoise = () => { | |
if (this.raining === true) { | |
console.log(this.noise); | |
} | |
}; | |
} |
class Store { | |
// We use the name and stock arguments passed in through new Store and set the revenue to start at 0. | |
constructor(name, stock) { | |
this.name = name; | |
this.stock = stock; | |
this.revenue = 0; | |
} | |
// In processProductSale, we loop through each stock item in our Store. Once we've found one with a name that matches the name of the product we want to process, we decrease its count by 1 and increase the store's revenue by the price of the item. | |
processProductSale(name) { |
import React from 'react'; | |
// import ReactDOM from 'react-dom/client'; | |
import {render} from 'react-dom' | |
import './index.css'; | |
import App from './App'; | |
import reportWebVitals from './reportWebVitals'; | |
const container = document.getElementById('root'); | |
render( | |
<React.StrictMode> |
import App from './App' | |
import { shallow } from 'enzyme' | |
// Test 1: Write a test that checks to see if our `App` component renders without throwing an error. | |
it('App Component Renders Without Error', () => { | |
const wrapper = shallow(<App />) | |
}) | |
// Test 2: Write a test that checks if the button within the `App` component renders properly. | |
it("App Component Renders a Button", () => { |
$ npm i --save react@16.14.0 react-dom@16.14.0 enzyme enzyme-adapter-react-16 --legacy-peer-deps
# push.yml | |
# Name of workflow | |
name: Push workflow | |
# When workflow is triggered | |
on: | |
push: | |
branches: | |
- dev |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>A Body of Content</title> | |
</head> | |
<body> |
<head>
tag with a <title>
tag inside.<h1>
tag and choose a title for it.<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Using <div> Tags</title> | |
</head> | |
<body> | |
<div id="header"> | |
<h1>Welcome to My Website</h1> | |
</div> | |
<div id="content"> |