Note: This post is a summary of information paraphrased from an excellent blog post by Christian Sepulveda.
Create the app and download the necessary dependencies.
import React, { useState, useEffect } from 'react' | |
import MemberMyFiles from './MemberMyFiles' | |
//import MemberMyCollection from './MemberMyCollection' | |
//import MemberMyDiscount from './MemberMyDiscount' | |
//import MemberInquire from './MemberInquire' | |
//import NotFoundPage from './NotFoundPage' | |
import { | |
BrowserRouter as Router, | |
Route, | |
Link, |
import React, { useState, useEffect } from 'react' | |
import Form from 'react-bootstrap/Form' | |
import { Col, Button, Row } from 'react-bootstrap' | |
import Spinner from 'react-bootstrap/Spinner' | |
import { BrowserRouter as Router } from 'react-router-dom' | |
function MyFile() { | |
const [validated, setValidated] = useState(false) | |
const [loading, setLoading] = useState(false) | |
const [user, setUser] = useState([]) |
import React, { useState, useEffect } from 'react'; | |
import { IoIosArrowForward } from 'react-icons/io'; | |
import { withRouter } from 'react-router-dom'; | |
import CartCounter from '../components/CartCounter' | |
import CartDelete from '../components/CartDelete' | |
import CartCheckbox from '../components/CartCheckbox' | |
import { Spinner } from 'react-bootstrap' | |
Create the app and download the necessary dependencies.
backup |
{ | |
// http://eslint.org/docs/rules/ | |
"ecmaFeatures": { | |
"binaryLiterals": false, // enable binary literals | |
"blockBindings": false, // enable let and const (aka block bindings) | |
"defaultParams": false, // enable default function parameters | |
"forOf": false, // enable for-of loops | |
"generators": false, // enable generators | |
"objectLiteralComputedProperties": false, // enable computed object literal property names |
| π | π | π | π |
π© | π | π | π | π¨ | π° | π£ | π’ | π | π | π² | π± | | π« | π | π‘ | π€ | πͺ | π | π·
π | π΅ | πΏ | π | π | πΆ | π | π½ | π | π | π | β€οΈ | π | π | π | π | π | π | π | β¨
// array utils | |
// ================================================================================================= | |
const combine = (...arrays) => [].concat(...arrays); | |
const compact = arr => arr.filter(Boolean); | |
const contains = (() => Array.prototype.includes | |
? (arr, value) => arr.includes(value) | |
: (arr, value) => arr.some(el => el === value) |
import React from 'react' | |
var Child = React.createClass({ | |
getInitialState: function(){ | |
console.log('Child getInitialState'); | |
return { value: 'start'} | |
}, | |
getDefaultProps: function(){ | |
console.log('Child getDefaultProps'); |
func factorial(a: Int) -> Int { | |
let n = a | |
if(n == 1){ | |
return 1 | |
}else{ | |
return n*factorial(n-1) | |
} | |
} | |
factorial(5) |