- <= 16.3:
findDOMNode
is discouraged but accepted for certain use cases - 16.3 (2018-03-28):
forwardRef
is introduced: It can be used in HOCs to avoid usingfindDOMNode
on the enhanced component - 16.6 (2018-10-23):
findDOMNode
is deprecated inReact.StrictMode
- 16.7.alpha (2018-10-24):
React.Concurrent
mode is released: This mode extendsReact.StrictMode
in a way thatfindDOMNode
is deprecated in that mode too.
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 (window) { | |
'use strict'; | |
const $ = window.jQuery; | |
/** | |
* put these members where they fit best. they were just put into one obj | |
* for better overview | |
* | |
* @type {{context: {owl: string, dcam: string, rdf: string, dcmi: string, xml: string, xsd: string, ia: string, nw: string, nwa: string, rdfs: string, dc: string}, data: *, query: query, byUri: byUri, byUris: byUris, byType: byType}} | |
*/ |
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 items = {}; | |
for (const row of document.querySelectorAll('tr td:nth-of-type(2)')) { | |
const full_name_element = row.querySelector('a.item_unique'); | |
if (full_name_element !== undefined) { | |
const full_name = full_name_element.innerText; | |
let implicits = []; |
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 { Omit } from 'utility-types'; | |
import { BaseItemTypeProps, EssenceProps, ModProps } from '../schema'; | |
/** | |
* *_mod_key is keyof mods/essenceMods.json | |
*/ | |
export interface NormalizedEssenceProps { | |
primary: number; | |
tier: number; |
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
// The problem, playground: https://bit.ly/2t9gDij | |
const getFirst = (arg: [number, number]) => arg[0]; | |
const getSecond = (arg: [number, number]) => arg[1]; | |
const foo = [1, 2]; | |
const foo_tuple = foo as Tuple2b<typeof foo>; | |
const firstBad = getFirst(foo); // $ExpectError | |
// the "solution" |
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
// jonschlinkert/is-object | |
type IsObjectObject<T> = T extends | |
| AnyArray | |
| AnyFunction | |
| boolean | |
| null | |
| number | |
| string | |
| symbol | |
| undefined |
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, { useContext } from "react"; | |
//styles | |
import * as S from "./styles"; | |
import * as A from "styles/shared-components"; | |
//components | |
import Header from "components/Header"; | |
import { AuthContext } from "components/Auth"; | |
import SpinnerComponent from "components/Spinner"; |
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
// Press ctrl+space for code completion | |
export default function transformer(file, api) { | |
const j = api.jscodeshift; | |
function hasPropsArgument(node) { | |
return node.params.length === 0 || node.params[0].name === 'props'; | |
} | |
function isFunctionComponent(path) { | |
const { node } = path; |
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 useIsControlled(value) { | |
const { current: isControlled } = React.useRef(value != null); | |
return isControlled; | |
} | |
function useControlled(config) { | |
const { value, defaultValue, setControlledValue } = config; | |
const isControlled = useIsControlled(value); | |
const [state, setState] = React.useState(defaultValue); |
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
# exclude i10n md files searching in vscode "files to exclude" | |
*-de.md,*-es.md,*-fr.md,*-ja.md,*-pt.md,*-zh.md,*-ru.md |
OlderNewer