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 Square(props) { // The properties of the square contain the "onClick" function as well as the "value" number | |
return ( | |
<button className="square" | |
onClick={props.onClick}>{/** (1) When I click on the button, it triggers the function onClick from the props object. */} | |
{props.value} | |
</button> | |
); | |
} |
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
unsafe-perm=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
node_modules | |
.env | |
.ebextensions | |
error.log | |
dist |
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 { View, TouchableOpacity } from "react-native"; | |
class MyChildComponent extends React.Component { | |
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
export const logAction = (name: string) => { | |
return (target, key, descriptor) => { | |
if(descriptor === undefined){ | |
descriptor = Object.getOwnPropertyDescriptor(target, key); | |
} | |
const originalMethod: Function = descriptor.value; | |
descriptor.value = async function() { | |
const args: Array<any> = []; |
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
interface ShopModel { | |
date: string; | |
} | |
class Shop extends ShopModel { | |
constructor(shop: ShopModel){ | |
this.date = shop.date; | |
} | |
get formattedDate() { |
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 bills = createStore([{id: 0, state: 0}, {id: 1, state: 2}]); | |
const selected = createStore(0); | |
const cheatersStore = createStoreObject({ | |
bills, | |
selected | |
}) | |
const validate = createEvent('validate') | |
bills.on(validate, (bills, idBill) => { |
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'; | |
interface Props { | |
if: boolean; | |
} | |
const Conditionnal: React.FC<Props> = props => { | |
if (props.if) { | |
return <React.Fragment>{props.children}</React.Fragment>; | |
} else { | |
return null; |
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 findItemAndIndexById = <T extends { id: string }>( | |
id: string, | |
tabWithId: T[] | |
): | |
| { | |
item: T; | |
index: number; | |
} | |
| undefined => { | |
let itemIndex = -1; |
OlderNewer