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
export const App = () => { | |
return ( | |
<main id="root"> | |
<h1>Hello Folks!</h1> | |
<p> | |
Random question: | |
Is <strong>FC Barcelona</strong> win any match in the Champions League this season? | |
</p> | |
</main> | |
); |
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
// What's wrong with that code? | |
this.setState({ | |
counter: this.state.counter + this.props.increment, | |
}); |
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
var Employee = { | |
company: 'xyz' | |
} | |
var emp1 = Object.create(Employee); | |
delete emp1.company | |
console.log(emp1.company); |
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
(...) | |
ProductDetailComponent.insertAfterJSX('<section className={classes.title} />', `<${ShortDescription} productSku={productDetails.sku} />`) |
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, { createContext, useReducer } from 'react'; | |
import { | |
MessagesReducer, | |
messagesInitialState, | |
addMessage as addMessageAction, |
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"; | |
export const Account = () => { | |
const [user, setUser] = useState({ name: "Marcin", country: "Poland" }); | |
<AccountDetails user={user} setUser={setUser} />; | |
}; | |
export const EditAccount = (props) => { | |
const { user, setUser } = props; |
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, { Fragment } from 'react'; | |
import { FormattedMessage, useIntl } from 'react-intl'; | |
import { Form } from 'informed'; | |
import { func, shape, string, arrayOf, number } from 'prop-types'; | |
import { useGuestForm } from '@magento/peregrine/lib/talons/CheckoutPage/ShippingInformation/AddressForm/useGuestForm'; | |
import { mergeClasses } from '../../../../classify'; | |
import { isRequired } from '../../../../util/formValidators'; | |
import Button from '../../../Button'; | |
import Country from '../../../Country'; |
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 from 'react'; | |
import { render, getByText } from '@testing-library/react'; | |
import ErrorMessage from '../ErrorMessage'; | |
test('ErrorMessage renders correctly', () => { | |
const { container } = render( |
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
const { Targetables } = require('@magento/pwa-buildpack'); | |
module.exports = targets => { | |
const targetables = Targetables.using(targets); | |
const ProductFullDetailComponent = targetables.reactComponent( | |
'@magento/venia-ui/lib/components/ProductFullDetail/productFullDetail.js' | |
); | |
ProductFullDetailComponent.insertBeforeJSX('<Button type="submit" />', '<span>Hello World! </span>'); |
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 create @magento/pwa | |
$ cd <project_dir> | |
$ yarn run buildpack create-custom-origin | |
$ yarn run watch |
NewerOlder