This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
test: /\.css$/, | |
loader: 'style-loader!css-loader', | |
}, | |
{ | |
test: /\.scss$/, | |
loader: 'style!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]', | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yarn add create-react-app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ yarn global add create-react-app | |
$ npm install -g create-react-app | |
$ create-react-app NOME_PROJETO | |
$ cd NOME_PROJETO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying my Blockstack ID is secured with the address 1BwQZHU6Hi4xA1KoYao83Swad5bbfeBtxd https://explorer.blockstack.org/address/1BwQZHU6Hi4xA1KoYao83Swad5bbfeBtxd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function describe(description, callback) { | |
console.log(description); | |
callback(); | |
} | |
function it(description, callback) { | |
console.log(description); | |
callback(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe("booleans", () => { | |
it("false === false", () => { | |
expect(false).toBe(false); | |
}); | |
it("true === true", () => { | |
expect(true).toBe(true); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test('setOpenIndex sets the open index state properly', () => { | |
const wrapper = mount(<Accordion items={[]} />) | |
expect(wrapper.state('openIndex')).toBe(0) | |
wrapper.instance().setOpenIndex(1) | |
expect(wrapper.state('openIndex')).toBe(1) | |
}) | |
test('Accordion renders AccordionContents with the item contents', () => { | |
const hats = {title: 'Favorite Hats', contents: 'Fedoras are classy'} | |
const footware = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test('can open accordion items to see the contents', () => { | |
const hats = {title: 'Favorite Hats', contents: 'Fedoras are classy'} | |
const footware = { | |
title: 'Favorite Footware', | |
contents: 'Flipflops are the best', | |
} | |
render(<Accordion items={[hats, footware]} />) | |
expect(screen.getByText(hats.contents)).toBeInTheDocument() | |
expect(screen.queryByText(footware.contents)).not.toBeInTheDocument() | |
userEvent.click(screen.getByText(footware.title)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react'; | |
function App() { | |
const [name, setName] = useState(""); | |
const [email, setEmail] = useState(""); | |
const onSubmit = () => { | |
// do something with `${name}` and `${email}` | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useReducer } from 'react'; | |
const initialState = { count: 0 }; | |
function reducer(state, action) { | |
switch (action.type) { | |
case 'INCREMENT': | |
return {count: state.count + 1}; | |
case 'DECREMENT': | |
return {count: state.count - 1}; |