- Carefully do the official [tutorial][].
- Read the official guide to [main concepts][].
- Read the official [advanced guides][].
- Watch [building React from scratch][] to get an idea of how React actually works (this covers the "stack" reconciler which was used in React 15 and earlier).
- Go through the [React "fiber" architecture][] which is the default reconciler since React 16.
- Go crazy, build your own projects, and stop doing React tutorials!
This file contains hidden or 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 runWithDebugger(callback, args) { | |
debugger; | |
callback.apply(null, args); | |
} |
This file contains hidden or 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
// librarySystem with dependencies | |
(function () { | |
var libraryStorage = {}; | |
function librarySystem(libraryName, dependencies, callback) { | |
// If librarySystem is called in 'create' mode, store the library. | |
if (arguments.length === 3) { | |
// If the library has dependencies, fetch the dependencies first and then store the library. |
This file contains hidden or 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
/** | |
* Match for patterns: `function (...) {...}` and `(...) => {...}` | |
* (`...` could be zero or more words, digits, spaces, underscores, commas) | |
*/ | |
/function\s*\(([\w\d\s_,]*)\)\s*\{([^}]*)\}|\(([\w\d\s_,]*)\)\s*=>\s*\{([^}]*)\}/gi | |
/** | |
* Match for patterns: `function (...)` and `(...) =>` | |
* (`...` could be zero or more words, digits, spaces, underscores, commas) | |
*/ |
This file contains hidden or 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
// Credits: Kent C. Dodds https://github.com/kentcdodds | |
// Ref: https://github.com/kentcdodds/ama/issues/406#issuecomment-391764106 | |
// Tip: load up the below script in a Quokka buffer to have the list just waiting in your clipboard | |
const {execSync, spawn} = require('child_process') | |
const result = execSync('code --list-extensions') | |
const list = String(result) | |
.split('\n') |
This file contains hidden or 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
{"contents":{"editor":{"insertSpaces":false},"files":{"trimTrailingWhitespace":true,"exclude":{".git":true,".build":true,"**/.DS_Store":true,"build/**/*.js":{"when":"$(basename).ts"}},"associations":{"OSSREADME.json":"jsonc"}},"search":{"exclude":{"**/node_modules":true,"**/bower_components":true,".build/**":true,"out/**":true,"out-build/**":true,"out-vscode/**":true,"i18n/**":true,"extensions/**/out/**":true,"test/smoke/out/**":true}},"tslint":{"enable":true},"lcov":{"path":["./.build/coverage/lcov.info","./.build/coverage-single/lcov.info"],"watch":[{"pattern":"**/*.test.js","command":"${workspaceFolder}/scripts/test.sh --coverage --run ${file}","windows":{"command":"${workspaceFolder}\\scripts\\test.bat --coverage --run ${file}"}}]},"typescript":{"tsdk":"node_modules/typescript/lib","preferences":{"importModuleSpecifier":"non-relative","quoteStyle":"single"}},"npm":{"exclude":"**/extensions/**"},"emmet":{"excludeLanguages":[]},"launch":{"version":"0.1.0","configurations":[{"type":"node","request":"launch", |
This file contains hidden or 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
/** | |
* Second Implementation | |
* | |
* 1. The function `bind(a, b)` will return the calling function with the first | |
* argument as context for, and the rest of the arguments as arguments to the | |
* returned function. | |
* | |
* 2. In addition to the bind call, the `valueOf` property on every function | |
* type is the function that is called whenever the JS runtime needs to typecast | |
* that function to a primitive type. The type of variable actually being |
This file contains hidden or 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 utilities = { | |
/** | |
* Manually parse a time string back to a Date object. | |
* Read the following to understand why Date.parse() cannot be relied upon: | |
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse | |
* https://stackoverflow.com/a/20463521 | |
* | |
* @param {string} time - The time to be parsed in the ISO 8601 format. | |
* @returns {Date} | |
*/ |
This file contains hidden or 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
/** | |
* A function that emits a side effect and returns a promise. | |
*/ | |
type Procedure = (...args: any[]) => Promise<void>; | |
/** | |
* `debounceAsync` debounces promise-returning & async functions. | |
* Adapted from Sindre's p-debounce. | |
* Ref: https://github.com/sindresorhus/p-debounce | |
* |
This file contains hidden or 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
/** | |
* querySelectorAll with regex support. | |
* Adapted from: https://stackoverflow.com/a/62144522. | |
* | |
* Note: In the `attributeToSearch` parameter's absence, all attributes on all | |
* DOM nodes will be searched. This can get quite expensive for large DOM trees. | |
* | |
* Usage example: | |
* `querySelectorAllRegex(/someregex/, 'target-specific-attribute-if-needed');` | |
* |
OlderNewer