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 App() { | |
const [firstName, setFirstName] = useState(""); | |
const [middleName, setMiddleName] = useState(""); | |
const [lastName, setLastName] = useState(""); | |
return ( | |
<div className="App"> | |
</div> |
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 PersonalInformation({ | |
firstName, | |
middleName, | |
lastName, | |
setFirstName, | |
setMiddleName, | |
setLastName | |
}) { | |
return ( | |
<div> |
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 default class ContainerComponent extends Component { | |
state = { firstName: "", lastName: "", address: "", data: [] }; | |
componentDidMount() { | |
axios.get("/url/blablabla").then(res => this.setState({ data: res.data })); | |
} | |
onChangeEvent = () => { | |
// Complex logic here... |
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
// MEDIA QUERY MANAGER | |
/* | |
0 - 600px: Phone | |
600 - 900px: Tablet portrait | |
900 - 1200px: Tablet landscape | |
[1200 - 1800] is where our normal styles apply | |
1800px + : Big desktop | |
$breakpoint arguement choices: | |
- phone |
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
use iframer; | |
update sale s set FullyPaid=1 | |
where YEAR(s.Created) between 2012 and 2018 and s.FramerID = 'bea8ac99-04dd-48da-8db8-ba572bf8ffe2'; | |
select * from sale s |
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 AppDispatcher from './AppDispatcher'; | |
export const updateNumberOfPeople = (value) => { | |
const action = { type: 'UPDATE_NUMBER_OF_PEOPLE', value }; | |
AppDispatcher.dispatch(action); | |
} | |
export const updateSlicesPerPerson = (value) => { |
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 initialState = { | |
numberOfPeople: 10, | |
slicesPerPerson: 2, | |
}; | |
//We then use this HOC like so: WithCalculator(**component goes here**) | |
//This makes use of arrow functions(=>) and anonymous class construction(returns `class`) | |
const WithCalculator = WrappedComponent => { | |
return class extends Component { | |
static displayName = `WithCalculator(${WrappedComponent.displayName || |
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, { Component } from 'react'; | |
// import axios from 'axios'; | |
import AnotherComponent from './AnotherComponent'; | |
import Todo from './Todo'; | |
import ParentComponent from './ParentComponent'; | |
export default class App extends ParentComponent { | |
constructor(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, { Component } from 'react'; | |
// import axios from 'axios'; | |
import AnotherComponent from './AnotherComponent'; | |
import Todo from './Todo'; | |
import ParentComponent from './ParentComponent'; | |
export default class App extends Component { | |
constructor(props) { |