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 Q, { forwardRef as J0, useImperativeHandle as K0, useState as ht, useMemo as Z0, useCallback as em, useRef as Cl } from "react"; | |
import { useQuery as tm, QueryClient as rm, QueryClientProvider as am } from "@tanstack/react-query"; | |
import { ToastContainer as nm } from "react-toastify"; | |
import { useParams as um, useHistory as Df, HashRouter as im, Switch as om, Route as sm } from "react-router-dom"; | |
import { Form as Mf, Card as Va, Skeleton as lm, Row as dm, Col as ar, Button as Er, Modal as fm, Upload as cm } from "antd"; | |
import { useTranslation as cr } from "react-i18next"; | |
import { e as Je, a as Oa } from "./axios.provider.js"; | |
import { A as gt, i as vm, b as pm, O as mm } from "./index17.js"; | |
import { S as Rl, T as Pa, L as _m } from "./UploadInput.module.js"; | |
import { S as Xa, E as fr } from "./ToastsTemplates.js"; |
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
# GitHub Action that will run prettier on the whole repo and commit the changes to the PR. | |
name: Prettier | |
on: | |
pull_request: | |
branches: [main] | |
jobs: | |
prettier: | |
runs-on: ubuntu-latest |
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 Component(){ | |
const [searchTerm, setSearchTerm] = React.useState("") | |
const filterWithGoodName = React.useMemo(() => { | |
return searchTerm.filter(.....) | |
}, [searchTerm]) | |
return ( | |
<input onSearch={setSearchTerm}/> | |
} |
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 buildSearchGroups(term, searchFields) { | |
const searchGroups = []; | |
if (term) { | |
const searchTermList = term.trim().split(' '); | |
searchTermList.forEach(searchTerm => { | |
const searchGroup = { m: 'or' }; | |
searchFields.forEach(field => { |
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
HOC is a function with a component that return a new component. | |
//geolocation.js | |
function withGeolocation(Component) { | |
function Geolocation() { | |
const [latitude, setLatitude] = React.useState(0); | |
const [longitude, setLongitude] = React.useState(0); | |
React.useEffect(() => { |
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
Using hooks with useEffect like this : | |
useState(async ()=>{ | |
const response = await fetch(url); | |
const json = await response.json(); | |
setData(json); | |
} | |
- with Classes using compenentDidMount or willMount : |
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
Using hooks with useEffect like this : | |
useState(async ()=>{ | |
const response = await fetch(url); | |
const json = await response.json(); | |
setData(json); | |
} | |
- with Classes using compenentDidMount or willMount : |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Propinas</title> | |
<link rel="stylesheet" type="text/css" href="css/normalize.css" /> | |
<link rel="stylesheet" type="text/css" href="css/styles.css" /> | |
</head> | |
<body> | |
<div id="container"> |