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
$ yarn test --prod | |
yarn run v1.22.22 | |
$ node ./scripts/jest/jest-cli.js --prod | |
$ NODE_ENV=production RELEASE_CHANNEL=experimental compactConsole=false node ./scripts/jest/jest.js --config ./scripts/jest/config.source.js | |
Running tests for default (experimental)... | |
FAIL packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js | |
● ReactHooksWithNoopRenderer › useEffect › errors thrown in passive destroy function within unmounted trees › should use the nearest still-mounted boundary if there are no unmounted boundaries | |
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
// Pins 0 and 1 are reserved for USB serial communication. | |
static const int MIN_PIN = 2; | |
static int prevStates[NUM_DIGITAL_PINS]; | |
void setup() { | |
for (int i = MIN_PIN; i < NUM_DIGITAL_PINS; i++) { | |
pinMode(i, INPUT_PULLUP); | |
// Pin states are 0 or 1. We print pin states as they change. Initializing | |
// them all to -1 means we print them all on the first loop. | |
prevStates[i] = -1; |
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
// How to use react-compiler-webpack with experimental decorators | |
// With @babel/plugin-syntax-decorators installed: | |
defineReactCompilerLoaderOption({ | |
babelTransFormOpt: { | |
parserOpts: { | |
plugins: ['decorators'] | |
} | |
} | |
}) |
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
import React, { Component } from 'react'; | |
import Checkbox from '@material-ui/core/Checkbox'; | |
/** | |
* Tri-state wrapper for material-ui checkbox | |
* @prop {boolean | null} checked - the state of the checkbox | |
* true means checked | |
* false means unchecked | |
* null (or undefined) means indeterminate | |
* @prop {(event, checked: boolean | null) => void} onChange |
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 JavaScript implementation of the Python range function. | |
* @param {number} a - start, or stop if b is not given | |
* @param {number} [b] - stop | |
* @param {number} [step=1] | |
* @throws {TypeError} if a non-integer argument is given | |
* @return {number[]} | |
* range(a) => [0, 1, ..., a-1] ([] if a <= 0) | |
* range(a, b) => [a, a+1, ..., b-1] ([] if a >= b) | |
* range(a, b, s) => [a, a+s, a+2*s, ..., a+n*s] for max int n s.t. a+n*s < b ([] if a >= b) |