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
1c1 | |
< /** @license React v16.4.2 | |
--- | |
> /** @license React v16.4.3-alpha.0 | |
18d17 | |
< var invariant = require('fbjs/lib/invariant'); | |
20,21d18 | |
< var warning = require('fbjs/lib/warning'); | |
< var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment'); | |
23d19 |
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
type SubscribableConfig = { | |
// Maps property names of subscribable data sources (e.g. 'someObservable'), | |
// To state names for subscribed values (e.g. 'someValue'). | |
subscribablePropertiesMap: {[subscribableProperty: string]: string}, | |
// Synchronously get data for a given subscribable property. | |
// It is okay to return null if the subscribable does not support sync value reading. | |
getDataFor: (subscribable: any, propertyName: string) => any, | |
// Subscribe to a given subscribable. |
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, { Component, Fragment, Suspense } from 'react'; | |
import read from './Resource'; | |
// Wait long enough for DevTools to see | |
const wait = (ms = 1) => { | |
const startTime = performance.now(); | |
while (performance.now() - startTime < ms) { | |
// ... | |
} | |
}; |
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, {useEffect, useRef, useState} from 'react'; | |
import {Animated, Text} from 'react-native'; | |
// Begin https://unpkg.com/react-native-animation-hooks@1.0.1/build/AnimationHooks.js | |
export const useAnimatedValue = initialValue => { | |
const ref = useRef(new Animated.Value(initialValue)); | |
return ref.current; | |
}; | |
const getInitialValue = config => { | |
if (typeof config.initialValue !== 'undefined') return config.initialValue; |
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
{ | |
"version": 1, | |
"profilingSummary": { | |
"commitDurations": [ | |
8.130000089295208, | |
2.7099999133497477, | |
0.40499994065612555, | |
0.3299998352304101, | |
0.3400000277906656, | |
0.33000006806105375, |
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
{ | |
"version": 2, | |
"profilingSummary": { | |
"commitDurations": [ | |
2.555000042775646, | |
0.0450000079581514, | |
0.054999967687763274, | |
2.4800000683171675, | |
0.03999999898951501, | |
0.0350000336766243, |
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
// Let's say you have a component (LoadingComponent), | |
// That renders a placeholder when props.isLoading is true, | |
// And renders a ChildComponent when props.isLoading is false. | |
function LoadingComponent(props) { | |
const { isLoading, ...rest } = props; | |
if (isLoading) { | |
return null; | |
} else { | |
return <ChildComponent {...rest} />; | |
} |
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
/** @flow */ | |
import Immutable from 'immutable' | |
import { createSelector } from 'reselect' | |
const LOCAL_STORAGE_KEY = 'LocalStorageModule' | |
const ACTION_TYPES = { | |
REMOVE: 'REMOVE_ACTION', | |
SET: 'SET_ACTION' | |
} |
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 * as React from "react"; | |
import * as rbush from "rbush"; | |
export const SelectableContext = React.createContext(); | |
export class SelectableGroup extends React.PureComponent { | |
static defaultProps = { | |
tolerance: 10 | |
}; |
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 jestDiff = require("jest-diff"); | |
describe("error boundaries", () => { | |
let BrokenRender; | |
let DidCatchErrorBoundary; | |
let GetDerivedErrorBoundary; | |
let React; | |
let ReactNoop; | |
let ReactFeatureFlags; | |
let ReactTestRenderer; |