Showing preview only (1,575K chars total). Download the full file or copy to clipboard to get everything.
Repository: ruanyf/react-demos
Branch: master
Commit: 86ae6304ff36
Files: 27
Total size: 1.5 MB
Directory structure:
gitextract_79p0ubh_/
├── .gitignore
├── README.md
├── build/
│ ├── prop-types.js
│ ├── react-dom.development.js
│ ├── react.development.js
│ └── react.js
├── demo01/
│ └── index.html
├── demo02/
│ └── index.html
├── demo03/
│ └── index.html
├── demo04/
│ └── index.html
├── demo05/
│ └── index.html
├── demo06/
│ └── index.html
├── demo07/
│ └── index.html
├── demo08/
│ └── index.html
├── demo09/
│ └── index.html
├── demo10/
│ └── index.html
├── demo11/
│ └── index.html
├── demo12/
│ └── index.html
└── demo13/
├── .babelrc
├── README.md
├── app.js
├── browser.js
├── package.json
├── server.js
└── src/
├── app.js
├── browser.js
└── server.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
example/
node_modules
================================================
FILE: README.md
================================================
This is a collection of simple demos of React.js.
These demos are purposely written in a simple and clear style. You will find no difficulty in following them to learn the powerful library.
## Related Projects
- [Flux Demo](https://github.com/ruanyf/extremely-simple-flux-demo)
- [Webpack Demos](https://github.com/ruanyf/webpack-demos)
- [React Router Tutorial](https://github.com/reactjs/react-router-tutorial)
- [CSS Modules Demos](https://github.com/ruanyf/css-modules-demos)
- [React Testing Demo](https://github.com/ruanyf/react-testing-demo)
- [A boilerplate for React-Babel-Webpack project](https://github.com/ruanyf/react-babel-webpack-boilerplate)
## How to use
First, copy the repo into your disk.
```bash
$ git clone git@github.com:ruanyf/react-demos.git
```
Then play with the source files under the repo's demo* directories.
## HTML Template
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<script src="../build/react.development.js"></script>
<script src="../build/react-dom.development.js"></script>
<script src="../build/babel.min.js"></script>
</head>
<body>
<div id="example"></div>
<script type="text/babel">
// ** Our code goes here! **
</script>
</body>
</html>
```
## Index
1. [Render JSX](#demo01-render-jsx)
1. [Use JavaScript in JSX](#demo02-use-javascript-in-jsx)
1. [Use array in JSX](#demo03-use-array-in-jsx)
1. [Define a component](#demo04-define-a-component)
1. [this.props.children](#demo05-thispropschildren)
1. [PropTypes](#demo06-proptypes)
1. [Finding a DOM node](#demo07-finding-a-dom-node)
1. [this.state](#demo08-thisstate)
1. [Form](#demo09-form)
1. [Component Lifecycle](#demo10-component-lifecycle)
1. [Ajax](#demo11-ajax)
1. [Display value from a Promise](#demo12-display-value-from-a-promise)
1. [Server-side rendering](#demo13-server-side-rendering)
---
## Demo01: Render JSX
[demo](http://ruanyf.github.io/react-demos/demo01/) / [source](https://github.com/ruanyf/react-demos/blob/master/demo01/index.html)
The template syntax in React is called [JSX](http://facebook.github.io/react/docs/displaying-data.html#jsx-syntax). JSX allows you to use HTML tags in JavaScript code. `ReactDOM.render()` is the method which translates JSX into HTML and renders it into the specified DOM node.
```js
ReactDOM.render(
<h1>Hello, world!</h1>,
document.getElementById('example')
);
```
To actually perform the transformation in the browser, you must use `<script type="text/babel">` to indicate JSX code, and include `babel.min.js`, which is a [browser version](https://babeljs.io/docs/usage/browser/) of Babel and can be found in the [babel-core@6](https://www.npmjs.com/package/babel-core) npm release.
Before v0.14, React used `JSTransform.js` to translate `<script type="text/jsx">`, but this is now deprecated ([more info](https://facebook.github.io/react/blog/2015/06/12/deprecating-jstransform-and-react-tools.html)).
## Demo02: Use JavaScript in JSX
[demo](http://ruanyf.github.io/react-demos/demo02/) / [source](https://github.com/ruanyf/react-demos/blob/master/demo02/index.html)
You can also use JavaScript within JSX. Angle brackets (<) symbolize the beginning of HTML syntax, while curly brackets (`{`) represent the beginning of JavaScript syntax.
```js
var names = ['Alice', 'Emily', 'Kate'];
ReactDOM.render(
<div>
{
names.map(function (name) {
return <div>Hello, {name}!</div>
})
}
</div>,
document.getElementById('example')
);
```
## Demo03: Use array in JSX
[demo](http://ruanyf.github.io/react-demos/demo03/) / [source](https://github.com/ruanyf/react-demos/blob/master/demo03/index.html)
If a JavaScript variable is an array, JSX will implicitly concat all members of the array.
```js
var arr = [
<h1>Hello world!</h1>,
<h2>React is awesome</h2>,
];
ReactDOM.render(
<div>{arr}</div>,
document.getElementById('example')
);
```
## Demo04: Define a component
[demo](http://ruanyf.github.io/react-demos/demo04/) / [source](https://github.com/ruanyf/react-demos/blob/master/demo04/index.html)
`class ComponentName extends React.Component` creates a component class, which implements a render method to return a component instance of the class.
Before v16.0, React used `React.createClass()` to create a component class, but this is now deprecated ([more info](https://github.com/facebook/react/blob/master/CHANGELOG.md#removed-deprecations)).
```javascript
class HelloMessage extends React.Component {
render() {
return <h1>Hello {this.props.name}</h1>;
}
}
ReactDOM.render(
<HelloMessage name="John" />,
document.getElementById('example')
);
```
You can use `this.props.[attribute]` to access the attributes of a component. Example: `this.props.name` of `<HelloMessage name="John" />` is John.
Please remember the first letter of the component's name must be capitalized, otherwise, React will throw an error. For instance, `HelloMessage` as a component's name is OK, but `helloMessage` is not allowed. And a React component should only have one top child node.
```javascript
// wrong
class HelloMessage extends React.Component {
render() {
return <h1>
Hello {this.props.name}
</h1><p>
some text
</p>;
}
}
// correct
class HelloMessage extends React.Component {
render() {
return <div>
<h1>Hello {this.props.name}</h1>
<p>some text</p>
</div>;
}
}
```
## Demo05: this.props.children
[demo](http://ruanyf.github.io/react-demos/demo05/) / [source](https://github.com/ruanyf/react-demos/blob/master/demo05/index.html)
React uses `this.props.children` to access a component's children nodes.
```javascript
class NotesList extends React.Component {
render() {
return (
<ol>
{
React.Children.map(this.props.children, function (child) {
return <li>{child}</li>;
})
}
</ol>
);
}
}
ReactDOM.render(
<NotesList>
<span>hello</span>
<span>world</span>
</NotesList>,
document.getElementById('example')
);
```
Please be mindful that the value of `this.props.children` has three possibilities. If the component has no child node, the value is `undefined`; If it has a single child node, the value will be an object; If it has multiple children nodes, the result is an array. Keep this in mind as you code.
React gave us a utility [`React.Children`](https://facebook.github.io/react/docs/top-level-api.html#react.children) for dealing with the opaque data structure of `this.props.children`. You can use `React.Children.map` to iterate `this.props.children` without worrying if its data type is `undefined` or `object`. Check [official document](https://facebook.github.io/react/docs/top-level-api.html#react.children) for more methods `React.Children` offers.
## Demo06: PropTypes
[demo](http://ruanyf.github.io/react-demos/demo06/) / [source](https://github.com/ruanyf/react-demos/blob/master/demo06/index.html)
Components in React have many specific attributes which are called `props` and can be of any type.
Sometimes you need a way to validate these props. You don't want users have the freedom to input anything into your components.
React has a solution for this and it's called PropTypes.
```javascript
class MyTitle extends React.Component {
static propTypes = {
title: PropTypes.string.isRequired,
}
render() {
return <h1> {this.props.title} </h1>;
}
}
```
The above component `MyTitle` has a prop of `title`. PropTypes tells React that the title is required and its value should be a string.
Now we give `Title` a number value.
```javascript
var data = 123;
ReactDOM.render(
<MyTitle title={data} />,
document.getElementById('example')
);
```
Here, the prop doesn't pass the validation, and the console will show you an error message:
```bash
Warning: Failed propType: Invalid prop `title` of type `number` supplied to `MyTitle`, expected `string`.
```
Visit [official doc](https://reactjs.org/docs/typechecking-with-proptypes.html) for more PropTypes options.
P.S. If you want to give the props a default value, use `defaultProps`.
```javascript
class MyTitle extends React.Component {
constructor(props) {
super(props)
}
static defaultProps = {
title: 'Hello World',
}
render() {
return <h1> {this.props.title} </h1>;
}
}
ReactDOM.render(
<MyTitle />,
document.getElementById('example')
);
```
React.PropTypes has moved into a different package since React v15.5. ([more info](https://reactjs.org/docs/typechecking-with-proptypes.html)).
## Demo07: Finding a DOM node
[demo](http://ruanyf.github.io/react-demos/demo07/) / [source](https://github.com/ruanyf/react-demos/blob/master/demo07/index.html)
Sometimes you need to reference a DOM node in a component. React gives you the `ref` attribute to attach a DOM node to instance created by `React.createRef()`.
```js
class MyComponent extends React.Component {
constructor(props) {
super(props);
this.myTextInput = React.createRef();
this.handleClick = this.handleClick.bind(this)
}
handleClick() {
this.myTextInput.current.focus();
}
render() {
return (
<div>
<input type="text" ref={this.myTextInput} />
<input type="button" value="Focus the text input" onClick={this.handleClick} />
</div>
);
}
}
ReactDOM.render(
<MyComponent />,
document.getElementById('example')
);
```
Please be mindful that you could do that only after this component has been mounted into the DOM, otherwise you get `null`.
## Demo08: this.state
[demo](http://ruanyf.github.io/react-demos/demo08/) / [source](https://github.com/ruanyf/react-demos/blob/master/demo08/index.html)
React thinks of component as state machines, and uses `this.state` to hold component's state, `this.setState()` to update `this.state` and re-render the component.
```js
class LikeButton extends React.Component {
constructor(props) {
super(props)
this.state = {
liked: false
}
this.handleClick = this.handleClick.bind(this)
}
handleClick(event) {
this.setState({ liked: !this.state.liked });
}
render() {
var text = this.state.liked ? 'like' : 'haven\'t liked';
return (
<p onClick={this.handleClick}>
You {text} this. Click to toggle.
</p>
);
}
}
ReactDOM.render(
<LikeButton />,
document.getElementById('example')
);
```
You could use component attributes to register event handlers, just like `onClick`, `onKeyDown`, `onCopy`, etc. Official Document has all [supported events](http://facebook.github.io/react/docs/events.html#supported-events).
## Demo09: Form
[demo](http://ruanyf.github.io/react-demos/demo09/) / [source](https://github.com/ruanyf/react-demos/blob/master/demo09/index.html)
According to React's design philosophy, `this.state` describes the state of component and is mutated via user interactions, and `this.props` describes the properties of component and is stable and immutable.
Since that, the `value` attribute of Form components, such as <input>, <textarea>, and <option>, is unaffected by any user input. If you wanted to access or update the value in response to user input, you could use the onChange event.
```js
class Input extends React.Component {
constructor(props) {
super(props)
this.state = {value: 'Hello!'}
this.handleChange = this.handleChange.bind(this)
}
handleChange(event) {
this.setState({value: event.target.value});
}
render() {
var value = this.state.value;
return (
<div>
<input type="text" value={value} onChange={this.handleChange} />
<p>{value}</p>
</div>
);
}
}
ReactDOM.render(<Input/>, document.getElementById('example'));
```
More information on [official document](http://facebook.github.io/react/docs/forms.html).
## Demo10: Component Lifecycle
[demo](http://ruanyf.github.io/react-demos/demo10/) / [source](https://github.com/ruanyf/react-demos/blob/master/demo10/index.html)
Components have three main parts of [their lifecycle](https://facebook.github.io/react/docs/working-with-the-browser.html#component-lifecycle): Mounting(being inserted into the DOM), Updating(being re-rendered) and Unmounting(being removed from the DOM). React provides hooks into these lifecycle part. `will` methods are called right before something happens, and `did` methods which are called right after something happens.
```js
class Hello extends React.Component {
constructor(props) {
super(props)
this.state = {opacity: 1.0};
}
componentDidMount() {
this.timer = setInterval(function () {
var opacity = this.state.opacity;
opacity -= .05;
if (opacity < 0.1) {
opacity = 1.0;
}
this.setState({
opacity: opacity
});
}.bind(this), 100);
}
render() {
return (
<div style={{opacity: this.state.opacity}}>
Hello {this.props.name}
</div>
);
}
}
ReactDOM.render(
<Hello name="world"/>,
document.getElementById('example')
);
```
The following is [a whole list of lifecycle methods](http://facebook.github.io/react/docs/component-specs.html#lifecycle-methods).
- **componentWillMount()**: Fired once, before initial rendering occurs. Good place to wire-up message listeners. `this.setState` doesn't work here.
- **componentDidMount()**: Fired once, after initial rendering occurs. Can use `this.getDOMNode()`.
- **componentWillUpdate(object nextProps, object nextState)**: Fired after the component's updates are made to the DOM. Can use `this.getDOMNode()` for updates.
- **componentDidUpdate(object prevProps, object prevState)**: Invoked immediately after the component's updates are flushed to the DOM. This method is not called for the initial render. Use this as an opportunity to operate on the DOM when the component has been updated.
- **componentWillUnmount()**: Fired immediately before a component is unmounted from the DOM. Good place to remove message listeners or general clean up.
- **componentWillReceiveProps(object nextProps)**: Fired when a component is receiving new props. You might want to `this.setState` depending on the props.
- **shouldComponentUpdate(object nextProps, object nextState)**: Fired before rendering when new props or state are received. `return false` if you know an update isn't needed.
## Demo11: Ajax
[demo](http://ruanyf.github.io/react-demos/demo11/) / [source](https://github.com/ruanyf/react-demos/blob/master/demo11/index.html)
How to get the data of a component from a server or an API provider? The answer is using Ajax to fetch data in the event handler of `componentDidMount`. When the server response arrives, store the data with `this.setState()` to trigger a re-render of your UI.
```js
class UserGist extends React.Component {
constructor(props) {
super(props)
this.state = {
username: '',
lastGistUrl: ''
};
}
componentDidMount() {
$.get(this.props.source, function(result) {
var lastGist = result[0];
this.setState({
username: lastGist.owner.login,
lastGistUrl: lastGist.html_url
});
}.bind(this));
}
render() {
return (
<div>
{this.state.username}'s last gist is
<a href={this.state.lastGistUrl}>here</a>.
</div>
);
}
}
ReactDOM.render(
<UserGist source="https://api.github.com/users/octocat/gists" />,
document.getElementById('example')
);
```
## Demo12: Display value from a Promise
[demo](http://ruanyf.github.io/react-demos/demo12/) / [source](https://github.com/ruanyf/react-demos/blob/master/demo12/index.html)
This demo is inspired by Nat Pryce's article ["Higher Order React Components"](http://natpryce.com/articles/000814.html).
If a React component's data is received asynchronously, we can also use a Promise object as the component's property, as follows.
```javascript
ReactDOM.render(
<RepoList promise={$.getJSON('https://api.github.com/search/repositories?q=javascript&sort=stars')} />,
document.getElementById('example')
);
```
The above code takes data from Github's API, and the `RepoList` component gets a Promise object as its property.
Now, while the promise is pending, the component displays a loading indicator. When the promise is resolved successfully, the component displays a list of repository information. If the promise is rejected, the component displays an error message.
```javascript
class RepoList extends React.Component {
constructor(props) {
super(props)
this.state = {
loading: true,
error: null,
data: null
};
}
componentDidMount() {
this.props.promise.then(
value => this.setState({loading: false, data: value}),
error => this.setState({loading: false, error: error}));
}
render() {
if (this.state.loading) {
return <span>Loading...</span>;
}
else if (this.state.error !== null) {
return <span>Error: {this.state.error.message}</span>;
}
else {
var repos = this.state.data.items;
var repoList = repos.map(function (repo, index) {
return (
<li key={index}><a href={repo.html_url}>{repo.name}</a> ({repo.stargazers_count} stars) <br/> {repo.description}</li>
);
});
return (
<main>
<h1>Most Popular JavaScript Projects in Github</h1>
<ol>{repoList}</ol>
</main>
);
}
}
}
```
## Demo13: Server-side rendering
[source](https://github.com/ruanyf/react-demos/tree/master/demo13/src)
This demo is copied from [github.com/mhart/react-server-example](https://github.com/mhart/react-server-example), but I rewrote it with JSX syntax.
```bash
# install the dependencies in demo13 directory
$ npm install
# translate all jsx file in src subdirectory to js file
$ npm run build
# launch http server
$ node server.js
```
## Extras
### Precompiling JSX
All above demos don't use JSX compilation for clarity. In production environment, ensure to precompile JSX files before putting them online.
First, install the command-line tools [Babel](https://babeljs.io/docs/usage/cli/).
```bash
$ npm install -g babel
```
Then precompile your JSX files(.jsx) into JavaScript(.js). Compiling the entire src directory and output it to the build directory, you may use the option `--out-dir` or `-d`.
```bash
$ babel src --out-dir build
```
Put the compiled JS files into HTML.
```html
<!DOCTYPE html>
<html>
<head>
<title>Hello React!</title>
<script src="build/react.js"></script>
<script src="build/react-dom.js"></script>
<!-- No need for Browser.js! -->
</head>
<body>
<div id="example"></div>
<script src="build/helloworld.js"></script>
</body>
</html>
```
## Useful links
- [React's official site](http://facebook.github.io/react)
- [React's official examples](https://github.com/facebook/react/tree/master/examples)
- [React (Virtual) DOM Terminology](http://facebook.github.io/react/docs/glossary.html), by Sebastian Markbåge
- [The React Quick Start Guide](http://www.jackcallister.com/2015/01/05/the-react-quick-start-guide.html), by Jack Callister
- [Learning React.js: Getting Started and Concepts](https://scotch.io/tutorials/learning-react-getting-started-and-concepts), by Ken Wheeler
- [Getting started with React](http://ryanclark.me/getting-started-with-react), by Ryan Clark
- [React JS Tutorial and Guide to the Gotchas](https://zapier.com/engineering/react-js-tutorial-guide-gotchas/), by Justin Deal
- [React Primer](https://github.com/BinaryMuse/react-primer), by Binary Muse
- [jQuery versus React.js thinking](http://blog.zigomir.com/react.js/jquery/2015/01/11/jquery-versus-react-thinking.html), by zigomir
## License
BSD licensed
================================================
FILE: build/prop-types.js
================================================
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.PropTypes = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
var printWarning = function() {};
if ("development" !== 'production') {
var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
var loggedTypeFailures = {};
printWarning = function(text) {
var message = 'Warning: ' + text;
if (typeof console !== 'undefined') {
console.error(message);
}
try {
// --- Welcome to debugging React ---
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch (x) {}
};
}
/**
* Assert that the values match with the type specs.
* Error messages are memorized and will only be shown once.
*
* @param {object} typeSpecs Map of name to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @param {string} componentName Name of the component for error messages.
* @param {?Function} getStack Returns the component stack.
* @private
*/
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
if ("development" !== 'production') {
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
var error;
// Prop type validation may throw. In case they do, we don't want to
// fail the render phase where it didn't fail before. So we log it.
// After these have been cleaned up, we'll let them throw.
try {
// This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message.
if (typeof typeSpecs[typeSpecName] !== 'function') {
var err = Error(
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
);
err.name = 'Invariant Violation';
throw err;
}
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
} catch (ex) {
error = ex;
}
if (error && !(error instanceof Error)) {
printWarning(
(componentName || 'React class') + ': type specification of ' +
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
'You may have forgotten to pass an argument to the type checker ' +
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
'shape all require an argument).'
)
}
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var stack = getStack ? getStack() : '';
printWarning(
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
);
}
}
}
}
}
module.exports = checkPropTypes;
},{"./lib/ReactPropTypesSecret":5}],2:[function(require,module,exports){
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
function emptyFunction() {}
module.exports = function() {
function shim(props, propName, componentName, location, propFullName, secret) {
if (secret === ReactPropTypesSecret) {
// It is still safe when called from React.
return;
}
var err = new Error(
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
'Use PropTypes.checkPropTypes() to call them. ' +
'Read more at http://fb.me/use-check-prop-types'
);
err.name = 'Invariant Violation';
throw err;
};
shim.isRequired = shim;
function getShim() {
return shim;
};
// Important!
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
var ReactPropTypes = {
array: shim,
bool: shim,
func: shim,
number: shim,
object: shim,
string: shim,
symbol: shim,
any: shim,
arrayOf: getShim,
element: shim,
instanceOf: getShim,
node: shim,
objectOf: getShim,
oneOf: getShim,
oneOfType: getShim,
shape: getShim,
exact: getShim
};
ReactPropTypes.checkPropTypes = emptyFunction;
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
},{"./lib/ReactPropTypesSecret":5}],3:[function(require,module,exports){
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
var assign = require('object-assign');
var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
var checkPropTypes = require('./checkPropTypes');
var printWarning = function() {};
if ("development" !== 'production') {
printWarning = function(text) {
var message = 'Warning: ' + text;
if (typeof console !== 'undefined') {
console.error(message);
}
try {
// --- Welcome to debugging React ---
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch (x) {}
};
}
function emptyFunctionThatReturnsNull() {
return null;
}
module.exports = function(isValidElement, throwOnDirectAccess) {
/* global Symbol */
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
/**
* Returns the iterator method function contained on the iterable object.
*
* Be sure to invoke the function with the iterable as context:
*
* var iteratorFn = getIteratorFn(myIterable);
* if (iteratorFn) {
* var iterator = iteratorFn.call(myIterable);
* ...
* }
*
* @param {?object} maybeIterable
* @return {?function}
*/
function getIteratorFn(maybeIterable) {
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
/**
* Collection of methods that allow declaration and validation of props that are
* supplied to React components. Example usage:
*
* var Props = require('ReactPropTypes');
* var MyArticle = React.createClass({
* propTypes: {
* // An optional string prop named "description".
* description: Props.string,
*
* // A required enum prop named "category".
* category: Props.oneOf(['News','Photos']).isRequired,
*
* // A prop named "dialog" that requires an instance of Dialog.
* dialog: Props.instanceOf(Dialog).isRequired
* },
* render: function() { ... }
* });
*
* A more formal specification of how these methods are used:
*
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
* decl := ReactPropTypes.{type}(.isRequired)?
*
* Each and every declaration produces a function with the same signature. This
* allows the creation of custom validation functions. For example:
*
* var MyLink = React.createClass({
* propTypes: {
* // An optional string or URI prop named "href".
* href: function(props, propName, componentName) {
* var propValue = props[propName];
* if (propValue != null && typeof propValue !== 'string' &&
* !(propValue instanceof URI)) {
* return new Error(
* 'Expected a string or an URI for ' + propName + ' in ' +
* componentName
* );
* }
* }
* },
* render: function() {...}
* });
*
* @internal
*/
var ANONYMOUS = '<<anonymous>>';
// Important!
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
var ReactPropTypes = {
array: createPrimitiveTypeChecker('array'),
bool: createPrimitiveTypeChecker('boolean'),
func: createPrimitiveTypeChecker('function'),
number: createPrimitiveTypeChecker('number'),
object: createPrimitiveTypeChecker('object'),
string: createPrimitiveTypeChecker('string'),
symbol: createPrimitiveTypeChecker('symbol'),
any: createAnyTypeChecker(),
arrayOf: createArrayOfTypeChecker,
element: createElementTypeChecker(),
instanceOf: createInstanceTypeChecker,
node: createNodeChecker(),
objectOf: createObjectOfTypeChecker,
oneOf: createEnumTypeChecker,
oneOfType: createUnionTypeChecker,
shape: createShapeTypeChecker,
exact: createStrictShapeTypeChecker,
};
/**
* inlined Object.is polyfill to avoid requiring consumers ship their own
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
*/
/*eslint-disable no-self-compare*/
function is(x, y) {
// SameValue algorithm
if (x === y) {
// Steps 1-5, 7-10
// Steps 6.b-6.e: +0 != -0
return x !== 0 || 1 / x === 1 / y;
} else {
// Step 6.a: NaN == NaN
return x !== x && y !== y;
}
}
/*eslint-enable no-self-compare*/
/**
* We use an Error-like object for backward compatibility as people may call
* PropTypes directly and inspect their output. However, we don't use real
* Errors anymore. We don't inspect their stack anyway, and creating them
* is prohibitively expensive if they are created too often, such as what
* happens in oneOfType() for any type before the one that matched.
*/
function PropTypeError(message) {
this.message = message;
this.stack = '';
}
// Make `instanceof Error` still work for returned errors.
PropTypeError.prototype = Error.prototype;
function createChainableTypeChecker(validate) {
if ("development" !== 'production') {
var manualPropTypeCallCache = {};
var manualPropTypeWarningCount = 0;
}
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
componentName = componentName || ANONYMOUS;
propFullName = propFullName || propName;
if (secret !== ReactPropTypesSecret) {
if (throwOnDirectAccess) {
// New behavior only for users of `prop-types` package
var err = new Error(
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
'Use `PropTypes.checkPropTypes()` to call them. ' +
'Read more at http://fb.me/use-check-prop-types'
);
err.name = 'Invariant Violation';
throw err;
} else if ("development" !== 'production' && typeof console !== 'undefined') {
// Old behavior for people using React.PropTypes
var cacheKey = componentName + ':' + propName;
if (
!manualPropTypeCallCache[cacheKey] &&
// Avoid spamming the console because they are often not actionable except for lib authors
manualPropTypeWarningCount < 3
) {
printWarning(
'You are manually calling a React.PropTypes validation ' +
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
'and will throw in the standalone `prop-types` package. ' +
'You may be seeing this warning due to a third-party PropTypes ' +
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
);
manualPropTypeCallCache[cacheKey] = true;
manualPropTypeWarningCount++;
}
}
}
if (props[propName] == null) {
if (isRequired) {
if (props[propName] === null) {
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
}
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
}
return null;
} else {
return validate(props, propName, componentName, location, propFullName);
}
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
function createPrimitiveTypeChecker(expectedType) {
function validate(props, propName, componentName, location, propFullName, secret) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== expectedType) {
// `propValue` being instance of, say, date/regexp, pass the 'object'
// check, but we can offer a more precise error message here rather than
// 'of type `object`'.
var preciseType = getPreciseType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createAnyTypeChecker() {
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
}
function createArrayOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
}
var propValue = props[propName];
if (!Array.isArray(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
}
for (var i = 0; i < propValue.length; i++) {
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createElementTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!isValidElement(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createInstanceTypeChecker(expectedClass) {
function validate(props, propName, componentName, location, propFullName) {
if (!(props[propName] instanceof expectedClass)) {
var expectedClassName = expectedClass.name || ANONYMOUS;
var actualClassName = getClassName(props[propName]);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createEnumTypeChecker(expectedValues) {
if (!Array.isArray(expectedValues)) {
"development" !== 'production' ? printWarning('Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
return emptyFunctionThatReturnsNull;
}
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
for (var i = 0; i < expectedValues.length; i++) {
if (is(propValue, expectedValues[i])) {
return null;
}
}
var valuesString = JSON.stringify(expectedValues);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
}
return createChainableTypeChecker(validate);
}
function createObjectOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
}
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
}
for (var key in propValue) {
if (propValue.hasOwnProperty(key)) {
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createUnionTypeChecker(arrayOfTypeCheckers) {
if (!Array.isArray(arrayOfTypeCheckers)) {
"development" !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
return emptyFunctionThatReturnsNull;
}
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (typeof checker !== 'function') {
printWarning(
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
);
return emptyFunctionThatReturnsNull;
}
}
function validate(props, propName, componentName, location, propFullName) {
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
return null;
}
}
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
}
return createChainableTypeChecker(validate);
}
function createNodeChecker() {
function validate(props, propName, componentName, location, propFullName) {
if (!isNode(props[propName])) {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
}
for (var key in shapeTypes) {
var checker = shapeTypes[key];
if (!checker) {
continue;
}
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createStrictShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
}
// We need to check all keys in case some are required but missing from
// props.
var allKeys = assign({}, props[propName], shapeTypes);
for (var key in allKeys) {
var checker = shapeTypes[key];
if (!checker) {
return new PropTypeError(
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
);
}
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function isNode(propValue) {
switch (typeof propValue) {
case 'number':
case 'string':
case 'undefined':
return true;
case 'boolean':
return !propValue;
case 'object':
if (Array.isArray(propValue)) {
return propValue.every(isNode);
}
if (propValue === null || isValidElement(propValue)) {
return true;
}
var iteratorFn = getIteratorFn(propValue);
if (iteratorFn) {
var iterator = iteratorFn.call(propValue);
var step;
if (iteratorFn !== propValue.entries) {
while (!(step = iterator.next()).done) {
if (!isNode(step.value)) {
return false;
}
}
} else {
// Iterator will provide entry [k,v] tuples rather than values.
while (!(step = iterator.next()).done) {
var entry = step.value;
if (entry) {
if (!isNode(entry[1])) {
return false;
}
}
}
}
} else {
return false;
}
return true;
default:
return false;
}
}
function isSymbol(propType, propValue) {
// Native Symbol.
if (propType === 'symbol') {
return true;
}
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
if (propValue['@@toStringTag'] === 'Symbol') {
return true;
}
// Fallback for non-spec compliant Symbols which are polyfilled.
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
return true;
}
return false;
}
// Equivalent of `typeof` but with special handling for array and regexp.
function getPropType(propValue) {
var propType = typeof propValue;
if (Array.isArray(propValue)) {
return 'array';
}
if (propValue instanceof RegExp) {
// Old webkits (at least until Android 4.0) return 'function' rather than
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
// passes PropTypes.object.
return 'object';
}
if (isSymbol(propType, propValue)) {
return 'symbol';
}
return propType;
}
// This handles more types than `getPropType`. Only used for error messages.
// See `createPrimitiveTypeChecker`.
function getPreciseType(propValue) {
if (typeof propValue === 'undefined' || propValue === null) {
return '' + propValue;
}
var propType = getPropType(propValue);
if (propType === 'object') {
if (propValue instanceof Date) {
return 'date';
} else if (propValue instanceof RegExp) {
return 'regexp';
}
}
return propType;
}
// Returns a string that is postfixed to a warning about an invalid type.
// For example, "undefined" or "of type array"
function getPostfixForTypeWarning(value) {
var type = getPreciseType(value);
switch (type) {
case 'array':
case 'object':
return 'an ' + type;
case 'boolean':
case 'date':
case 'regexp':
return 'a ' + type;
default:
return type;
}
}
// Returns class name of the object, if any.
function getClassName(propValue) {
if (!propValue.constructor || !propValue.constructor.name) {
return ANONYMOUS;
}
return propValue.constructor.name;
}
ReactPropTypes.checkPropTypes = checkPropTypes;
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
},{"./checkPropTypes":1,"./lib/ReactPropTypesSecret":5,"object-assign":6}],4:[function(require,module,exports){
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
if ("development" !== 'production') {
var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
Symbol.for &&
Symbol.for('react.element')) ||
0xeac7;
var isValidElement = function(object) {
return typeof object === 'object' &&
object !== null &&
object.$$typeof === REACT_ELEMENT_TYPE;
};
// By explicitly using `prop-types` you are opting into new development behavior.
// http://fb.me/prop-types-in-prod
var throwOnDirectAccess = true;
module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);
} else {
// By explicitly using `prop-types` you are opting into new production behavior.
// http://fb.me/prop-types-in-prod
module.exports = require('./factoryWithThrowingShims')();
}
},{"./factoryWithThrowingShims":2,"./factoryWithTypeCheckers":3}],5:[function(require,module,exports){
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;
},{}],6:[function(require,module,exports){
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
'use strict';
/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val === null || val === undefined) {
throw new TypeError('Object.assign cannot be called with null or undefined');
}
return Object(val);
}
function shouldUseNative() {
try {
if (!Object.assign) {
return false;
}
// Detect buggy property enumeration order in older V8 versions.
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
test1[5] = 'de';
if (Object.getOwnPropertyNames(test1)[0] === '5') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test2 = {};
for (var i = 0; i < 10; i++) {
test2['_' + String.fromCharCode(i)] = i;
}
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
return test2[n];
});
if (order2.join('') !== '0123456789') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test3 = {};
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join('') !==
'abcdefghijklmnopqrst') {
return false;
}
return true;
} catch (err) {
// We don't expect any of the above to throw, but better to be safe.
return false;
}
}
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
var from;
var to = toObject(target);
var symbols;
for (var s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from) {
if (hasOwnProperty.call(from, key)) {
to[key] = from[key];
}
}
if (getOwnPropertySymbols) {
symbols = getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
},{}]},{},[4])(4)
});
================================================
FILE: build/react-dom.development.js
================================================
/** @license React v16.7.0
* react-dom.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react')) :
typeof define === 'function' && define.amd ? define(['react'], factory) :
(global.ReactDOM = factory(global.React));
}(this, (function (React) { 'use strict';
/**
* Use invariant() to assert state which your program assumes to be true.
*
* Provide sprintf-style format (only %s is supported) and arguments
* to provide information about what broke and what you were
* expecting.
*
* The invariant message will be stripped in production, but the invariant
* will remain to ensure logic does not differ in production.
*/
var validateFormat = function () {};
{
validateFormat = function (format) {
if (format === undefined) {
throw new Error('invariant requires an error message argument');
}
};
}
function invariant(condition, format, a, b, c, d, e, f) {
validateFormat(format);
if (!condition) {
var error = void 0;
if (format === undefined) {
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
} else {
var args = [a, b, c, d, e, f];
var argIndex = 0;
error = new Error(format.replace(/%s/g, function () {
return args[argIndex++];
}));
error.name = 'Invariant Violation';
}
error.framesToPop = 1; // we don't care about invariant's own frame
throw error;
}
}
// Relying on the `invariant()` implementation lets us
// preserve the format and params in the www builds.
!React ? invariant(false, 'ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.') : void 0;
var invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) {
var funcArgs = Array.prototype.slice.call(arguments, 3);
try {
func.apply(context, funcArgs);
} catch (error) {
this.onError(error);
}
};
{
// In DEV mode, we swap out invokeGuardedCallback for a special version
// that plays more nicely with the browser's DevTools. The idea is to preserve
// "Pause on exceptions" behavior. Because React wraps all user-provided
// functions in invokeGuardedCallback, and the production version of
// invokeGuardedCallback uses a try-catch, all user exceptions are treated
// like caught exceptions, and the DevTools won't pause unless the developer
// takes the extra step of enabling pause on caught exceptions. This is
// untintuitive, though, because even though React has caught the error, from
// the developer's perspective, the error is uncaught.
//
// To preserve the expected "Pause on exceptions" behavior, we don't use a
// try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake
// DOM node, and call the user-provided callback from inside an event handler
// for that fake event. If the callback throws, the error is "captured" using
// a global event handler. But because the error happens in a different
// event loop context, it does not interrupt the normal program flow.
// Effectively, this gives us try-catch behavior without actually using
// try-catch. Neat!
// Check that the browser supports the APIs we need to implement our special
// DEV version of invokeGuardedCallback
if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
var fakeNode = document.createElement('react');
var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) {
// If document doesn't exist we know for sure we will crash in this method
// when we call document.createEvent(). However this can cause confusing
// errors: https://github.com/facebookincubator/create-react-app/issues/3482
// So we preemptively throw with a better message instead.
!(typeof document !== 'undefined') ? invariant(false, 'The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.') : void 0;
var evt = document.createEvent('Event');
// Keeps track of whether the user-provided callback threw an error. We
// set this to true at the beginning, then set it to false right after
// calling the function. If the function errors, `didError` will never be
// set to false. This strategy works even if the browser is flaky and
// fails to call our global error handler, because it doesn't rely on
// the error event at all.
var didError = true;
// Keeps track of the value of window.event so that we can reset it
// during the callback to let user code access window.event in the
// browsers that support it.
var windowEvent = window.event;
// Keeps track of the descriptor of window.event to restore it after event
// dispatching: https://github.com/facebook/react/issues/13688
var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event');
// Create an event handler for our fake event. We will synchronously
// dispatch our fake event using `dispatchEvent`. Inside the handler, we
// call the user-provided callback.
var funcArgs = Array.prototype.slice.call(arguments, 3);
function callCallback() {
// We immediately remove the callback from event listeners so that
// nested `invokeGuardedCallback` calls do not clash. Otherwise, a
// nested call would trigger the fake event handlers of any call higher
// in the stack.
fakeNode.removeEventListener(evtType, callCallback, false);
// We check for window.hasOwnProperty('event') to prevent the
// window.event assignment in both IE <= 10 as they throw an error
// "Member not found" in strict mode, and in Firefox which does not
// support window.event.
if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) {
window.event = windowEvent;
}
func.apply(context, funcArgs);
didError = false;
}
// Create a global error event handler. We use this to capture the value
// that was thrown. It's possible that this error handler will fire more
// than once; for example, if non-React code also calls `dispatchEvent`
// and a handler for that event throws. We should be resilient to most of
// those cases. Even if our error event handler fires more than once, the
// last error event is always used. If the callback actually does error,
// we know that the last error event is the correct one, because it's not
// possible for anything else to have happened in between our callback
// erroring and the code that follows the `dispatchEvent` call below. If
// the callback doesn't error, but the error event was fired, we know to
// ignore it because `didError` will be false, as described above.
var error = void 0;
// Use this to track whether the error event is ever called.
var didSetError = false;
var isCrossOriginError = false;
function handleWindowError(event) {
error = event.error;
didSetError = true;
if (error === null && event.colno === 0 && event.lineno === 0) {
isCrossOriginError = true;
}
if (event.defaultPrevented) {
// Some other error handler has prevented default.
// Browsers silence the error report if this happens.
// We'll remember this to later decide whether to log it or not.
if (error != null && typeof error === 'object') {
try {
error._suppressLogging = true;
} catch (inner) {
// Ignore.
}
}
}
}
// Create a fake event type.
var evtType = 'react-' + (name ? name : 'invokeguardedcallback');
// Attach our event handlers
window.addEventListener('error', handleWindowError);
fakeNode.addEventListener(evtType, callCallback, false);
// Synchronously dispatch our fake event. If the user-provided function
// errors, it will trigger our global error handler.
evt.initEvent(evtType, false, false);
fakeNode.dispatchEvent(evt);
if (windowEventDescriptor) {
Object.defineProperty(window, 'event', windowEventDescriptor);
}
if (didError) {
if (!didSetError) {
// The callback errored, but the error event never fired.
error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');
} else if (isCrossOriginError) {
error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.');
}
this.onError(error);
}
// Remove our event listeners
window.removeEventListener('error', handleWindowError);
};
invokeGuardedCallbackImpl = invokeGuardedCallbackDev;
}
}
var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;
// Used by Fiber to simulate a try-catch.
var hasError = false;
var caughtError = null;
// Used by event system to capture/rethrow the first error.
var hasRethrowError = false;
var rethrowError = null;
var reporter = {
onError: function (error) {
hasError = true;
caughtError = error;
}
};
/**
* Call a function while guarding against errors that happens within it.
* Returns an error if it throws, otherwise null.
*
* In production, this is implemented using a try-catch. The reason we don't
* use a try-catch directly is so that we can swap out a different
* implementation in DEV mode.
*
* @param {String} name of the guard to use for logging or debugging
* @param {Function} func The function to invoke
* @param {*} context The context to use when calling the function
* @param {...*} args Arguments for function
*/
function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
hasError = false;
caughtError = null;
invokeGuardedCallbackImpl$1.apply(reporter, arguments);
}
/**
* Same as invokeGuardedCallback, but instead of returning an error, it stores
* it in a global so it can be rethrown by `rethrowCaughtError` later.
* TODO: See if caughtError and rethrowError can be unified.
*
* @param {String} name of the guard to use for logging or debugging
* @param {Function} func The function to invoke
* @param {*} context The context to use when calling the function
* @param {...*} args Arguments for function
*/
function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {
invokeGuardedCallback.apply(this, arguments);
if (hasError) {
var error = clearCaughtError();
if (!hasRethrowError) {
hasRethrowError = true;
rethrowError = error;
}
}
}
/**
* During execution of guarded functions we will capture the first error which
* we will rethrow to be handled by the top level error handler.
*/
function rethrowCaughtError() {
if (hasRethrowError) {
var error = rethrowError;
hasRethrowError = false;
rethrowError = null;
throw error;
}
}
function hasCaughtError() {
return hasError;
}
function clearCaughtError() {
if (hasError) {
var error = caughtError;
hasError = false;
caughtError = null;
return error;
} else {
invariant(false, 'clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.');
}
}
/**
* Injectable ordering of event plugins.
*/
var eventPluginOrder = null;
/**
* Injectable mapping from names to event plugin modules.
*/
var namesToPlugins = {};
/**
* Recomputes the plugin list using the injected plugins and plugin ordering.
*
* @private
*/
function recomputePluginOrdering() {
if (!eventPluginOrder) {
// Wait until an `eventPluginOrder` is injected.
return;
}
for (var pluginName in namesToPlugins) {
var pluginModule = namesToPlugins[pluginName];
var pluginIndex = eventPluginOrder.indexOf(pluginName);
!(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;
if (plugins[pluginIndex]) {
continue;
}
!pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;
plugins[pluginIndex] = pluginModule;
var publishedEvents = pluginModule.eventTypes;
for (var eventName in publishedEvents) {
!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;
}
}
}
/**
* Publishes an event so that it can be dispatched by the supplied plugin.
*
* @param {object} dispatchConfig Dispatch configuration for the event.
* @param {object} PluginModule Plugin publishing the event.
* @return {boolean} True if the event was successfully published.
* @private
*/
function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
!!eventNameDispatchConfigs.hasOwnProperty(eventName) ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : void 0;
eventNameDispatchConfigs[eventName] = dispatchConfig;
var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
if (phasedRegistrationNames) {
for (var phaseName in phasedRegistrationNames) {
if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
var phasedRegistrationName = phasedRegistrationNames[phaseName];
publishRegistrationName(phasedRegistrationName, pluginModule, eventName);
}
}
return true;
} else if (dispatchConfig.registrationName) {
publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);
return true;
}
return false;
}
/**
* Publishes a registration name that is used to identify dispatched events.
*
* @param {string} registrationName Registration name to add.
* @param {object} PluginModule Plugin publishing the event.
* @private
*/
function publishRegistrationName(registrationName, pluginModule, eventName) {
!!registrationNameModules[registrationName] ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : void 0;
registrationNameModules[registrationName] = pluginModule;
registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;
{
var lowerCasedName = registrationName.toLowerCase();
possibleRegistrationNames[lowerCasedName] = registrationName;
if (registrationName === 'onDoubleClick') {
possibleRegistrationNames.ondblclick = registrationName;
}
}
}
/**
* Registers plugins so that they can extract and dispatch events.
*
* @see {EventPluginHub}
*/
/**
* Ordered list of injected plugins.
*/
var plugins = [];
/**
* Mapping from event name to dispatch config
*/
var eventNameDispatchConfigs = {};
/**
* Mapping from registration name to plugin module
*/
var registrationNameModules = {};
/**
* Mapping from registration name to event name
*/
var registrationNameDependencies = {};
/**
* Mapping from lowercase registration names to the properly cased version,
* used to warn in the case of missing event handlers. Available
* only in true.
* @type {Object}
*/
var possibleRegistrationNames = {};
// Trust the developer to only use possibleRegistrationNames in true
/**
* Injects an ordering of plugins (by plugin name). This allows the ordering
* to be decoupled from injection of the actual plugins so that ordering is
* always deterministic regardless of packaging, on-the-fly injection, etc.
*
* @param {array} InjectedEventPluginOrder
* @internal
* @see {EventPluginHub.injection.injectEventPluginOrder}
*/
function injectEventPluginOrder(injectedEventPluginOrder) {
!!eventPluginOrder ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : void 0;
// Clone the ordering so it cannot be dynamically mutated.
eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);
recomputePluginOrdering();
}
/**
* Injects plugins to be used by `EventPluginHub`. The plugin names must be
* in the ordering injected by `injectEventPluginOrder`.
*
* Plugins can be injected as part of page initialization or on-the-fly.
*
* @param {object} injectedNamesToPlugins Map from names to plugin modules.
* @internal
* @see {EventPluginHub.injection.injectEventPluginsByName}
*/
function injectEventPluginsByName(injectedNamesToPlugins) {
var isOrderingDirty = false;
for (var pluginName in injectedNamesToPlugins) {
if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
continue;
}
var pluginModule = injectedNamesToPlugins[pluginName];
if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {
!!namesToPlugins[pluginName] ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : void 0;
namesToPlugins[pluginName] = pluginModule;
isOrderingDirty = true;
}
}
if (isOrderingDirty) {
recomputePluginOrdering();
}
}
/**
* Similar to invariant but only logs a warning if the condition is not met.
* This can be used to log issues in development environments in critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
var warningWithoutStack = function () {};
{
warningWithoutStack = function (condition, format) {
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
args[_key - 2] = arguments[_key];
}
if (format === undefined) {
throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
}
if (args.length > 8) {
// Check before the condition to catch violations early.
throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
}
if (condition) {
return;
}
if (typeof console !== 'undefined') {
var argsWithFormat = args.map(function (item) {
return '' + item;
});
argsWithFormat.unshift('Warning: ' + format);
// We intentionally don't use spread (or .apply) directly because it
// breaks IE9: https://github.com/facebook/react/issues/13610
Function.prototype.apply.call(console.error, console, argsWithFormat);
}
try {
// --- Welcome to debugging React ---
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
var argIndex = 0;
var message = 'Warning: ' + format.replace(/%s/g, function () {
return args[argIndex++];
});
throw new Error(message);
} catch (x) {}
};
}
var warningWithoutStack$1 = warningWithoutStack;
var getFiberCurrentPropsFromNode = null;
var getInstanceFromNode = null;
var getNodeFromInstance = null;
function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) {
getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl;
getInstanceFromNode = getInstanceFromNodeImpl;
getNodeFromInstance = getNodeFromInstanceImpl;
{
!(getNodeFromInstance && getInstanceFromNode) ? warningWithoutStack$1(false, 'EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
}
}
var validateEventDispatches = void 0;
{
validateEventDispatches = function (event) {
var dispatchListeners = event._dispatchListeners;
var dispatchInstances = event._dispatchInstances;
var listenersIsArr = Array.isArray(dispatchListeners);
var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
var instancesIsArr = Array.isArray(dispatchInstances);
var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
!(instancesIsArr === listenersIsArr && instancesLen === listenersLen) ? warningWithoutStack$1(false, 'EventPluginUtils: Invalid `event`.') : void 0;
};
}
/**
* Dispatch the event to the listener.
* @param {SyntheticEvent} event SyntheticEvent to handle
* @param {function} listener Application-level callback
* @param {*} inst Internal component instance
*/
function executeDispatch(event, listener, inst) {
var type = event.type || 'unknown-event';
event.currentTarget = getNodeFromInstance(inst);
invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);
event.currentTarget = null;
}
/**
* Standard/simple iteration through an event's collected dispatches.
*/
function executeDispatchesInOrder(event) {
var dispatchListeners = event._dispatchListeners;
var dispatchInstances = event._dispatchInstances;
{
validateEventDispatches(event);
}
if (Array.isArray(dispatchListeners)) {
for (var i = 0; i < dispatchListeners.length; i++) {
if (event.isPropagationStopped()) {
break;
}
// Listeners and Instances are two parallel arrays that are always in sync.
executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);
}
} else if (dispatchListeners) {
executeDispatch(event, dispatchListeners, dispatchInstances);
}
event._dispatchListeners = null;
event._dispatchInstances = null;
}
/**
* @see executeDispatchesInOrderStopAtTrueImpl
*/
/**
* Execution of a "direct" dispatch - there must be at most one dispatch
* accumulated on the event or it is considered an error. It doesn't really make
* sense for an event with multiple dispatches (bubbled) to keep track of the
* return values at each dispatch execution, but it does tend to make sense when
* dealing with "direct" dispatches.
*
* @return {*} The return value of executing the single dispatch.
*/
/**
* @param {SyntheticEvent} event
* @return {boolean} True iff number of dispatches accumulated is greater than 0.
*/
/**
* Accumulates items that must not be null or undefined into the first one. This
* is used to conserve memory by avoiding array allocations, and thus sacrifices
* API cleanness. Since `current` can be null before being passed in and not
* null after this function, make sure to assign it back to `current`:
*
* `a = accumulateInto(a, b);`
*
* This API should be sparingly used. Try `accumulate` for something cleaner.
*
* @return {*|array<*>} An accumulation of items.
*/
function accumulateInto(current, next) {
!(next != null) ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : void 0;
if (current == null) {
return next;
}
// Both are not empty. Warning: Never call x.concat(y) when you are not
// certain that x is an Array (x could be a string with concat method).
if (Array.isArray(current)) {
if (Array.isArray(next)) {
current.push.apply(current, next);
return current;
}
current.push(next);
return current;
}
if (Array.isArray(next)) {
// A bit too dangerous to mutate `next`.
return [current].concat(next);
}
return [current, next];
}
/**
* @param {array} arr an "accumulation" of items which is either an Array or
* a single item. Useful when paired with the `accumulate` module. This is a
* simple utility that allows us to reason about a collection of items, but
* handling the case when there is exactly one item (and we do not need to
* allocate an array).
* @param {function} cb Callback invoked with each element or a collection.
* @param {?} [scope] Scope used as `this` in a callback.
*/
function forEachAccumulated(arr, cb, scope) {
if (Array.isArray(arr)) {
arr.forEach(cb, scope);
} else if (arr) {
cb.call(scope, arr);
}
}
/**
* Internal queue of events that have accumulated their dispatches and are
* waiting to have their dispatches executed.
*/
var eventQueue = null;
/**
* Dispatches an event and releases it back into the pool, unless persistent.
*
* @param {?object} event Synthetic event to be dispatched.
* @private
*/
var executeDispatchesAndRelease = function (event) {
if (event) {
executeDispatchesInOrder(event);
if (!event.isPersistent()) {
event.constructor.release(event);
}
}
};
var executeDispatchesAndReleaseTopLevel = function (e) {
return executeDispatchesAndRelease(e);
};
function isInteractive(tag) {
return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
}
function shouldPreventMouseEvent(name, type, props) {
switch (name) {
case 'onClick':
case 'onClickCapture':
case 'onDoubleClick':
case 'onDoubleClickCapture':
case 'onMouseDown':
case 'onMouseDownCapture':
case 'onMouseMove':
case 'onMouseMoveCapture':
case 'onMouseUp':
case 'onMouseUpCapture':
return !!(props.disabled && isInteractive(type));
default:
return false;
}
}
/**
* This is a unified interface for event plugins to be installed and configured.
*
* Event plugins can implement the following properties:
*
* `extractEvents` {function(string, DOMEventTarget, string, object): *}
* Required. When a top-level event is fired, this method is expected to
* extract synthetic events that will in turn be queued and dispatched.
*
* `eventTypes` {object}
* Optional, plugins that fire events must publish a mapping of registration
* names that are used to register listeners. Values of this mapping must
* be objects that contain `registrationName` or `phasedRegistrationNames`.
*
* `executeDispatch` {function(object, function, string)}
* Optional, allows plugins to override how an event gets dispatched. By
* default, the listener is simply invoked.
*
* Each plugin that is injected into `EventsPluginHub` is immediately operable.
*
* @public
*/
/**
* Methods for injecting dependencies.
*/
var injection = {
/**
* @param {array} InjectedEventPluginOrder
* @public
*/
injectEventPluginOrder: injectEventPluginOrder,
/**
* @param {object} injectedNamesToPlugins Map from names to plugin modules.
*/
injectEventPluginsByName: injectEventPluginsByName
};
/**
* @param {object} inst The instance, which is the source of events.
* @param {string} registrationName Name of listener (e.g. `onClick`).
* @return {?function} The stored callback.
*/
function getListener(inst, registrationName) {
var listener = void 0;
// TODO: shouldPreventMouseEvent is DOM-specific and definitely should not
// live here; needs to be moved to a better place soon
var stateNode = inst.stateNode;
if (!stateNode) {
// Work in progress (ex: onload events in incremental mode).
return null;
}
var props = getFiberCurrentPropsFromNode(stateNode);
if (!props) {
// Work in progress.
return null;
}
listener = props[registrationName];
if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
return null;
}
!(!listener || typeof listener === 'function') ? invariant(false, 'Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener) : void 0;
return listener;
}
/**
* Allows registered plugins an opportunity to extract events from top-level
* native browser events.
*
* @return {*} An accumulation of synthetic events.
* @internal
*/
function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
var events = null;
for (var i = 0; i < plugins.length; i++) {
// Not every plugin in the ordering may be loaded at runtime.
var possiblePlugin = plugins[i];
if (possiblePlugin) {
var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
if (extractedEvents) {
events = accumulateInto(events, extractedEvents);
}
}
}
return events;
}
function runEventsInBatch(events) {
if (events !== null) {
eventQueue = accumulateInto(eventQueue, events);
}
// Set `eventQueue` to null before processing it so that we can tell if more
// events get enqueued while processing.
var processingEventQueue = eventQueue;
eventQueue = null;
if (!processingEventQueue) {
return;
}
forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
!!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0;
// This would be a good time to rethrow if any of the event handlers threw.
rethrowCaughtError();
}
function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
var events = extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
runEventsInBatch(events);
}
var FunctionComponent = 0;
var ClassComponent = 1;
var IndeterminateComponent = 2; // Before we know whether it is function or class
var HostRoot = 3; // Root of a host tree. Could be nested inside another node.
var HostPortal = 4; // A subtree. Could be an entry point to a different renderer.
var HostComponent = 5;
var HostText = 6;
var Fragment = 7;
var Mode = 8;
var ContextConsumer = 9;
var ContextProvider = 10;
var ForwardRef = 11;
var Profiler = 12;
var SuspenseComponent = 13;
var MemoComponent = 14;
var SimpleMemoComponent = 15;
var LazyComponent = 16;
var IncompleteClassComponent = 17;
var randomKey = Math.random().toString(36).slice(2);
var internalInstanceKey = '__reactInternalInstance$' + randomKey;
var internalEventHandlersKey = '__reactEventHandlers$' + randomKey;
function precacheFiberNode(hostInst, node) {
node[internalInstanceKey] = hostInst;
}
/**
* Given a DOM node, return the closest ReactDOMComponent or
* ReactDOMTextComponent instance ancestor.
*/
function getClosestInstanceFromNode(node) {
if (node[internalInstanceKey]) {
return node[internalInstanceKey];
}
while (!node[internalInstanceKey]) {
if (node.parentNode) {
node = node.parentNode;
} else {
// Top of the tree. This node must not be part of a React tree (or is
// unmounted, potentially).
return null;
}
}
var inst = node[internalInstanceKey];
if (inst.tag === HostComponent || inst.tag === HostText) {
// In Fiber, this will always be the deepest root.
return inst;
}
return null;
}
/**
* Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
* instance, or null if the node was not rendered by this React.
*/
function getInstanceFromNode$1(node) {
var inst = node[internalInstanceKey];
if (inst) {
if (inst.tag === HostComponent || inst.tag === HostText) {
return inst;
} else {
return null;
}
}
return null;
}
/**
* Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
* DOM node.
*/
function getNodeFromInstance$1(inst) {
if (inst.tag === HostComponent || inst.tag === HostText) {
// In Fiber this, is just the state node right now. We assume it will be
// a host component or host text.
return inst.stateNode;
}
// Without this first invariant, passing a non-DOM-component triggers the next
// invariant for a missing parent, which is super confusing.
invariant(false, 'getNodeFromInstance: Invalid argument.');
}
function getFiberCurrentPropsFromNode$1(node) {
return node[internalEventHandlersKey] || null;
}
function updateFiberProps(node, props) {
node[internalEventHandlersKey] = props;
}
function getParent(inst) {
do {
inst = inst.return;
// TODO: If this is a HostRoot we might want to bail out.
// That is depending on if we want nested subtrees (layers) to bubble
// events to their parent. We could also go through parentNode on the
// host node but that wouldn't work for React Native and doesn't let us
// do the portal feature.
} while (inst && inst.tag !== HostComponent);
if (inst) {
return inst;
}
return null;
}
/**
* Return the lowest common ancestor of A and B, or null if they are in
* different trees.
*/
function getLowestCommonAncestor(instA, instB) {
var depthA = 0;
for (var tempA = instA; tempA; tempA = getParent(tempA)) {
depthA++;
}
var depthB = 0;
for (var tempB = instB; tempB; tempB = getParent(tempB)) {
depthB++;
}
// If A is deeper, crawl up.
while (depthA - depthB > 0) {
instA = getParent(instA);
depthA--;
}
// If B is deeper, crawl up.
while (depthB - depthA > 0) {
instB = getParent(instB);
depthB--;
}
// Walk in lockstep until we find a match.
var depth = depthA;
while (depth--) {
if (instA === instB || instA === instB.alternate) {
return instA;
}
instA = getParent(instA);
instB = getParent(instB);
}
return null;
}
/**
* Return if A is an ancestor of B.
*/
/**
* Return the parent instance of the passed-in instance.
*/
/**
* Simulates the traversal of a two-phase, capture/bubble event dispatch.
*/
function traverseTwoPhase(inst, fn, arg) {
var path = [];
while (inst) {
path.push(inst);
inst = getParent(inst);
}
var i = void 0;
for (i = path.length; i-- > 0;) {
fn(path[i], 'captured', arg);
}
for (i = 0; i < path.length; i++) {
fn(path[i], 'bubbled', arg);
}
}
/**
* Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
* should would receive a `mouseEnter` or `mouseLeave` event.
*
* Does not invoke the callback on the nearest common ancestor because nothing
* "entered" or "left" that element.
*/
function traverseEnterLeave(from, to, fn, argFrom, argTo) {
var common = from && to ? getLowestCommonAncestor(from, to) : null;
var pathFrom = [];
while (true) {
if (!from) {
break;
}
if (from === common) {
break;
}
var alternate = from.alternate;
if (alternate !== null && alternate === common) {
break;
}
pathFrom.push(from);
from = getParent(from);
}
var pathTo = [];
while (true) {
if (!to) {
break;
}
if (to === common) {
break;
}
var _alternate = to.alternate;
if (_alternate !== null && _alternate === common) {
break;
}
pathTo.push(to);
to = getParent(to);
}
for (var i = 0; i < pathFrom.length; i++) {
fn(pathFrom[i], 'bubbled', argFrom);
}
for (var _i = pathTo.length; _i-- > 0;) {
fn(pathTo[_i], 'captured', argTo);
}
}
/**
* Some event types have a notion of different registration names for different
* "phases" of propagation. This finds listeners by a given phase.
*/
function listenerAtPhase(inst, event, propagationPhase) {
var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
return getListener(inst, registrationName);
}
/**
* A small set of propagation patterns, each of which will accept a small amount
* of information, and generate a set of "dispatch ready event objects" - which
* are sets of events that have already been annotated with a set of dispatched
* listener functions/ids. The API is designed this way to discourage these
* propagation strategies from actually executing the dispatches, since we
* always want to collect the entire set of dispatches before executing even a
* single one.
*/
/**
* Tags a `SyntheticEvent` with dispatched listeners. Creating this function
* here, allows us to not have to bind or create functions for each event.
* Mutating the event's members allows us to not have to create a wrapping
* "dispatch" object that pairs the event with the listener.
*/
function accumulateDirectionalDispatches(inst, phase, event) {
{
!inst ? warningWithoutStack$1(false, 'Dispatching inst must not be null') : void 0;
}
var listener = listenerAtPhase(inst, event, phase);
if (listener) {
event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
}
}
/**
* Collect dispatches (must be entirely collected before dispatching - see unit
* tests). Lazily allocate the array to conserve memory. We must loop through
* each event and perform the traversal for each one. We cannot perform a
* single traversal for the entire collection of events because each event may
* have a different target.
*/
function accumulateTwoPhaseDispatchesSingle(event) {
if (event && event.dispatchConfig.phasedRegistrationNames) {
traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
}
}
/**
* Accumulates without regard to direction, does not look for phased
* registration names. Same as `accumulateDirectDispatchesSingle` but without
* requiring that the `dispatchMarker` be the same as the dispatched ID.
*/
function accumulateDispatches(inst, ignoredDirection, event) {
if (inst && event && event.dispatchConfig.registrationName) {
var registrationName = event.dispatchConfig.registrationName;
var listener = getListener(inst, registrationName);
if (listener) {
event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
}
}
}
/**
* Accumulates dispatches on an `SyntheticEvent`, but only for the
* `dispatchMarker`.
* @param {SyntheticEvent} event
*/
function accumulateDirectDispatchesSingle(event) {
if (event && event.dispatchConfig.registrationName) {
accumulateDispatches(event._targetInst, null, event);
}
}
function accumulateTwoPhaseDispatches(events) {
forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
}
function accumulateEnterLeaveDispatches(leave, enter, from, to) {
traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
}
function accumulateDirectDispatches(events) {
forEachAccumulated(events, accumulateDirectDispatchesSingle);
}
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
// Do not uses the below two methods directly!
// Instead use constants exported from DOMTopLevelEventTypes in ReactDOM.
// (It is the only module that is allowed to access these methods.)
function unsafeCastStringToDOMTopLevelType(topLevelType) {
return topLevelType;
}
function unsafeCastDOMTopLevelTypeToString(topLevelType) {
return topLevelType;
}
/**
* Generate a mapping of standard vendor prefixes using the defined style property and event name.
*
* @param {string} styleProp
* @param {string} eventName
* @returns {object}
*/
function makePrefixMap(styleProp, eventName) {
var prefixes = {};
prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
prefixes['Webkit' + styleProp] = 'webkit' + eventName;
prefixes['Moz' + styleProp] = 'moz' + eventName;
return prefixes;
}
/**
* A list of event names to a configurable list of vendor prefixes.
*/
var vendorPrefixes = {
animationend: makePrefixMap('Animation', 'AnimationEnd'),
animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
animationstart: makePrefixMap('Animation', 'AnimationStart'),
transitionend: makePrefixMap('Transition', 'TransitionEnd')
};
/**
* Event names that have already been detected and prefixed (if applicable).
*/
var prefixedEventNames = {};
/**
* Element to check for prefixes on.
*/
var style = {};
/**
* Bootstrap if a DOM exists.
*/
if (canUseDOM) {
style = document.createElement('div').style;
// On some platforms, in particular some releases of Android 4.x,
// the un-prefixed "animation" and "transition" properties are defined on the
// style object but the events that fire will still be prefixed, so we need
// to check if the un-prefixed events are usable, and if not remove them from the map.
if (!('AnimationEvent' in window)) {
delete vendorPrefixes.animationend.animation;
delete vendorPrefixes.animationiteration.animation;
delete vendorPrefixes.animationstart.animation;
}
// Same as above
if (!('TransitionEvent' in window)) {
delete vendorPrefixes.transitionend.transition;
}
}
/**
* Attempts to determine the correct vendor prefixed event name.
*
* @param {string} eventName
* @returns {string}
*/
function getVendorPrefixedEventName(eventName) {
if (prefixedEventNames[eventName]) {
return prefixedEventNames[eventName];
} else if (!vendorPrefixes[eventName]) {
return eventName;
}
var prefixMap = vendorPrefixes[eventName];
for (var styleProp in prefixMap) {
if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
return prefixedEventNames[eventName] = prefixMap[styleProp];
}
}
return eventName;
}
/**
* To identify top level events in ReactDOM, we use constants defined by this
* module. This is the only module that uses the unsafe* methods to express
* that the constants actually correspond to the browser event names. This lets
* us save some bundle size by avoiding a top level type -> event name map.
* The rest of ReactDOM code should import top level types from this file.
*/
var TOP_ABORT = unsafeCastStringToDOMTopLevelType('abort');
var TOP_ANIMATION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationend'));
var TOP_ANIMATION_ITERATION = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationiteration'));
var TOP_ANIMATION_START = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationstart'));
var TOP_BLUR = unsafeCastStringToDOMTopLevelType('blur');
var TOP_CAN_PLAY = unsafeCastStringToDOMTopLevelType('canplay');
var TOP_CAN_PLAY_THROUGH = unsafeCastStringToDOMTopLevelType('canplaythrough');
var TOP_CANCEL = unsafeCastStringToDOMTopLevelType('cancel');
var TOP_CHANGE = unsafeCastStringToDOMTopLevelType('change');
var TOP_CLICK = unsafeCastStringToDOMTopLevelType('click');
var TOP_CLOSE = unsafeCastStringToDOMTopLevelType('close');
var TOP_COMPOSITION_END = unsafeCastStringToDOMTopLevelType('compositionend');
var TOP_COMPOSITION_START = unsafeCastStringToDOMTopLevelType('compositionstart');
var TOP_COMPOSITION_UPDATE = unsafeCastStringToDOMTopLevelType('compositionupdate');
var TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu');
var TOP_COPY = unsafeCastStringToDOMTopLevelType('copy');
var TOP_CUT = unsafeCastStringToDOMTopLevelType('cut');
var TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick');
var TOP_AUX_CLICK = unsafeCastStringToDOMTopLevelType('auxclick');
var TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag');
var TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend');
var TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter');
var TOP_DRAG_EXIT = unsafeCastStringToDOMTopLevelType('dragexit');
var TOP_DRAG_LEAVE = unsafeCastStringToDOMTopLevelType('dragleave');
var TOP_DRAG_OVER = unsafeCastStringToDOMTopLevelType('dragover');
var TOP_DRAG_START = unsafeCastStringToDOMTopLevelType('dragstart');
var TOP_DROP = unsafeCastStringToDOMTopLevelType('drop');
var TOP_DURATION_CHANGE = unsafeCastStringToDOMTopLevelType('durationchange');
var TOP_EMPTIED = unsafeCastStringToDOMTopLevelType('emptied');
var TOP_ENCRYPTED = unsafeCastStringToDOMTopLevelType('encrypted');
var TOP_ENDED = unsafeCastStringToDOMTopLevelType('ended');
var TOP_ERROR = unsafeCastStringToDOMTopLevelType('error');
var TOP_FOCUS = unsafeCastStringToDOMTopLevelType('focus');
var TOP_GOT_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('gotpointercapture');
var TOP_INPUT = unsafeCastStringToDOMTopLevelType('input');
var TOP_INVALID = unsafeCastStringToDOMTopLevelType('invalid');
var TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType('keydown');
var TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType('keypress');
var TOP_KEY_UP = unsafeCastStringToDOMTopLevelType('keyup');
var TOP_LOAD = unsafeCastStringToDOMTopLevelType('load');
var TOP_LOAD_START = unsafeCastStringToDOMTopLevelType('loadstart');
var TOP_LOADED_DATA = unsafeCastStringToDOMTopLevelType('loadeddata');
var TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType('loadedmetadata');
var TOP_LOST_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('lostpointercapture');
var TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType('mousedown');
var TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType('mousemove');
var TOP_MOUSE_OUT = unsafeCastStringToDOMTopLevelType('mouseout');
var TOP_MOUSE_OVER = unsafeCastStringToDOMTopLevelType('mouseover');
var TOP_MOUSE_UP = unsafeCastStringToDOMTopLevelType('mouseup');
var TOP_PASTE = unsafeCastStringToDOMTopLevelType('paste');
var TOP_PAUSE = unsafeCastStringToDOMTopLevelType('pause');
var TOP_PLAY = unsafeCastStringToDOMTopLevelType('play');
var TOP_PLAYING = unsafeCastStringToDOMTopLevelType('playing');
var TOP_POINTER_CANCEL = unsafeCastStringToDOMTopLevelType('pointercancel');
var TOP_POINTER_DOWN = unsafeCastStringToDOMTopLevelType('pointerdown');
var TOP_POINTER_MOVE = unsafeCastStringToDOMTopLevelType('pointermove');
var TOP_POINTER_OUT = unsafeCastStringToDOMTopLevelType('pointerout');
var TOP_POINTER_OVER = unsafeCastStringToDOMTopLevelType('pointerover');
var TOP_POINTER_UP = unsafeCastStringToDOMTopLevelType('pointerup');
var TOP_PROGRESS = unsafeCastStringToDOMTopLevelType('progress');
var TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType('ratechange');
var TOP_RESET = unsafeCastStringToDOMTopLevelType('reset');
var TOP_SCROLL = unsafeCastStringToDOMTopLevelType('scroll');
var TOP_SEEKED = unsafeCastStringToDOMTopLevelType('seeked');
var TOP_SEEKING = unsafeCastStringToDOMTopLevelType('seeking');
var TOP_SELECTION_CHANGE = unsafeCastStringToDOMTopLevelType('selectionchange');
var TOP_STALLED = unsafeCastStringToDOMTopLevelType('stalled');
var TOP_SUBMIT = unsafeCastStringToDOMTopLevelType('submit');
var TOP_SUSPEND = unsafeCastStringToDOMTopLevelType('suspend');
var TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType('textInput');
var TOP_TIME_UPDATE = unsafeCastStringToDOMTopLevelType('timeupdate');
var TOP_TOGGLE = unsafeCastStringToDOMTopLevelType('toggle');
var TOP_TOUCH_CANCEL = unsafeCastStringToDOMTopLevelType('touchcancel');
var TOP_TOUCH_END = unsafeCastStringToDOMTopLevelType('touchend');
var TOP_TOUCH_MOVE = unsafeCastStringToDOMTopLevelType('touchmove');
var TOP_TOUCH_START = unsafeCastStringToDOMTopLevelType('touchstart');
var TOP_TRANSITION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('transitionend'));
var TOP_VOLUME_CHANGE = unsafeCastStringToDOMTopLevelType('volumechange');
var TOP_WAITING = unsafeCastStringToDOMTopLevelType('waiting');
var TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel');
// List of events that need to be individually attached to media elements.
// Note that events in this list will *not* be listened to at the top level
// unless they're explicitly whitelisted in `ReactBrowserEventEmitter.listenTo`.
var mediaEventTypes = [TOP_ABORT, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_VOLUME_CHANGE, TOP_WAITING];
function getRawEventName(topLevelType) {
return unsafeCastDOMTopLevelTypeToString(topLevelType);
}
/**
* These variables store information about text content of a target node,
* allowing comparison of content before and after a given event.
*
* Identify the node where selection currently begins, then observe
* both its text content and its current position in the DOM. Since the
* browser may natively replace the target node during composition, we can
* use its position to find its replacement.
*
*
*/
var root = null;
var startText = null;
var fallbackText = null;
function initialize(nativeEventTarget) {
root = nativeEventTarget;
startText = getText();
return true;
}
function reset() {
root = null;
startText = null;
fallbackText = null;
}
function getData() {
if (fallbackText) {
return fallbackText;
}
var start = void 0;
var startValue = startText;
var startLength = startValue.length;
var end = void 0;
var endValue = getText();
var endLength = endValue.length;
for (start = 0; start < startLength; start++) {
if (startValue[start] !== endValue[start]) {
break;
}
}
var minEnd = startLength - start;
for (end = 1; end <= minEnd; end++) {
if (startValue[startLength - end] !== endValue[endLength - end]) {
break;
}
}
var sliceTail = end > 1 ? 1 - end : undefined;
fallbackText = endValue.slice(start, sliceTail);
return fallbackText;
}
function getText() {
if ('value' in root) {
return root.value;
}
return root.textContent;
}
var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
var _assign = ReactInternals.assign;
/* eslint valid-typeof: 0 */
var EVENT_POOL_SIZE = 10;
/**
* @interface Event
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var EventInterface = {
type: null,
target: null,
// currentTarget is set when dispatching; no use in copying it here
currentTarget: function () {
return null;
},
eventPhase: null,
bubbles: null,
cancelable: null,
timeStamp: function (event) {
return event.timeStamp || Date.now();
},
defaultPrevented: null,
isTrusted: null
};
function functionThatReturnsTrue() {
return true;
}
function functionThatReturnsFalse() {
return false;
}
/**
* Synthetic events are dispatched by event plugins, typically in response to a
* top-level event delegation handler.
*
* These systems should generally use pooling to reduce the frequency of garbage
* collection. The system should check `isPersistent` to determine whether the
* event should be released into the pool after being dispatched. Users that
* need a persisted event should invoke `persist`.
*
* Synthetic events (and subclasses) implement the DOM Level 3 Events API by
* normalizing browser quirks. Subclasses do not necessarily have to implement a
* DOM interface; custom application-specific events can also subclass this.
*
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {*} targetInst Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @param {DOMEventTarget} nativeEventTarget Target node.
*/
function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
{
// these have a getter/setter for warnings
delete this.nativeEvent;
delete this.preventDefault;
delete this.stopPropagation;
delete this.isDefaultPrevented;
delete this.isPropagationStopped;
}
this.dispatchConfig = dispatchConfig;
this._targetInst = targetInst;
this.nativeEvent = nativeEvent;
var Interface = this.constructor.Interface;
for (var propName in Interface) {
if (!Interface.hasOwnProperty(propName)) {
continue;
}
{
delete this[propName]; // this has a getter/setter for warnings
}
var normalize = Interface[propName];
if (normalize) {
this[propName] = normalize(nativeEvent);
} else {
if (propName === 'target') {
this.target = nativeEventTarget;
} else {
this[propName] = nativeEvent[propName];
}
}
}
var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
if (defaultPrevented) {
this.isDefaultPrevented = functionThatReturnsTrue;
} else {
this.isDefaultPrevented = functionThatReturnsFalse;
}
this.isPropagationStopped = functionThatReturnsFalse;
return this;
}
_assign(SyntheticEvent.prototype, {
preventDefault: function () {
this.defaultPrevented = true;
var event = this.nativeEvent;
if (!event) {
return;
}
if (event.preventDefault) {
event.preventDefault();
} else if (typeof event.returnValue !== 'unknown') {
event.returnValue = false;
}
this.isDefaultPrevented = functionThatReturnsTrue;
},
stopPropagation: function () {
var event = this.nativeEvent;
if (!event) {
return;
}
if (event.stopPropagation) {
event.stopPropagation();
} else if (typeof event.cancelBubble !== 'unknown') {
// The ChangeEventPlugin registers a "propertychange" event for
// IE. This event does not support bubbling or cancelling, and
// any references to cancelBubble throw "Member not found". A
// typeof check of "unknown" circumvents this issue (and is also
// IE specific).
event.cancelBubble = true;
}
this.isPropagationStopped = functionThatReturnsTrue;
},
/**
* We release all dispatched `SyntheticEvent`s after each event loop, adding
* them back into the pool. This allows a way to hold onto a reference that
* won't be added back into the pool.
*/
persist: function () {
this.isPersistent = functionThatReturnsTrue;
},
/**
* Checks if this event should be released back into the pool.
*
* @return {boolean} True if this should not be released, false otherwise.
*/
isPersistent: functionThatReturnsFalse,
/**
* `PooledClass` looks for `destructor` on each instance it releases.
*/
destructor: function () {
var Interface = this.constructor.Interface;
for (var propName in Interface) {
{
Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
}
}
this.dispatchConfig = null;
this._targetInst = null;
this.nativeEvent = null;
this.isDefaultPrevented = functionThatReturnsFalse;
this.isPropagationStopped = functionThatReturnsFalse;
this._dispatchListeners = null;
this._dispatchInstances = null;
{
Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse));
Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse));
Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {}));
Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {}));
}
}
});
SyntheticEvent.Interface = EventInterface;
/**
* Helper to reduce boilerplate when creating subclasses.
*/
SyntheticEvent.extend = function (Interface) {
var Super = this;
var E = function () {};
E.prototype = Super.prototype;
var prototype = new E();
function Class() {
return Super.apply(this, arguments);
}
_assign(prototype, Class.prototype);
Class.prototype = prototype;
Class.prototype.constructor = Class;
Class.Interface = _assign({}, Super.Interface, Interface);
Class.extend = Super.extend;
addEventPoolingTo(Class);
return Class;
};
addEventPoolingTo(SyntheticEvent);
/**
* Helper to nullify syntheticEvent instance properties when destructing
*
* @param {String} propName
* @param {?object} getVal
* @return {object} defineProperty object
*/
function getPooledWarningPropertyDefinition(propName, getVal) {
var isFunction = typeof getVal === 'function';
return {
configurable: true,
set: set,
get: get
};
function set(val) {
var action = isFunction ? 'setting the method' : 'setting the property';
warn(action, 'This is effectively a no-op');
return val;
}
function get() {
var action = isFunction ? 'accessing the method' : 'accessing the property';
var result = isFunction ? 'This is a no-op function' : 'This is set to null';
warn(action, result);
return getVal;
}
function warn(action, result) {
var warningCondition = false;
!warningCondition ? warningWithoutStack$1(false, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
}
}
function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {
var EventConstructor = this;
if (EventConstructor.eventPool.length) {
var instance = EventConstructor.eventPool.pop();
EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);
return instance;
}
return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst);
}
function releasePooledEvent(event) {
var EventConstructor = this;
!(event instanceof EventConstructor) ? invariant(false, 'Trying to release an event instance into a pool of a different type.') : void 0;
event.destructor();
if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {
EventConstructor.eventPool.push(event);
}
}
function addEventPoolingTo(EventConstructor) {
EventConstructor.eventPool = [];
EventConstructor.getPooled = getPooledEvent;
EventConstructor.release = releasePooledEvent;
}
/**
* @interface Event
* @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
*/
var SyntheticCompositionEvent = SyntheticEvent.extend({
data: null
});
/**
* @interface Event
* @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
* /#events-inputevents
*/
var SyntheticInputEvent = SyntheticEvent.extend({
data: null
});
var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
var START_KEYCODE = 229;
var canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window;
var documentMode = null;
if (canUseDOM && 'documentMode' in document) {
documentMode = document.documentMode;
}
// Webkit offers a very useful `textInput` event that can be used to
// directly represent `beforeInput`. The IE `textinput` event is not as
// useful, so we don't use it.
var canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode;
// In IE9+, we have access to composition events, but the data supplied
// by the native compositionend event may be incorrect. Japanese ideographic
// spaces, for instance (\u3000) are not recorded correctly.
var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
var SPACEBAR_CODE = 32;
var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
// Events and their corresponding property names.
var eventTypes = {
beforeInput: {
phasedRegistrationNames: {
bubbled: 'onBeforeInput',
captured: 'onBeforeInputCapture'
},
dependencies: [TOP_COMPOSITION_END, TOP_KEY_PRESS, TOP_TEXT_INPUT, TOP_PASTE]
},
compositionEnd: {
phasedRegistrationNames: {
bubbled: 'onCompositionEnd',
captured: 'onCompositionEndCapture'
},
dependencies: [TOP_BLUR, TOP_COMPOSITION_END, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
},
compositionStart: {
phasedRegistrationNames: {
bubbled: 'onCompositionStart',
captured: 'onCompositionStartCapture'
},
dependencies: [TOP_BLUR, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
},
compositionUpdate: {
phasedRegistrationNames: {
bubbled: 'onCompositionUpdate',
captured: 'onCompositionUpdateCapture'
},
dependencies: [TOP_BLUR, TOP_COMPOSITION_UPDATE, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
}
};
// Track whether we've ever handled a keypress on the space key.
var hasSpaceKeypress = false;
/**
* Return whether a native keypress event is assumed to be a command.
* This is required because Firefox fires `keypress` events for key commands
* (cut, copy, select-all, etc.) even though no character is inserted.
*/
function isKeypressCommand(nativeEvent) {
return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
// ctrlKey && altKey is equivalent to AltGr, and is not a command.
!(nativeEvent.ctrlKey && nativeEvent.altKey);
}
/**
* Translate native top level events into event types.
*
* @param {string} topLevelType
* @return {object}
*/
function getCompositionEventType(topLevelType) {
switch (topLevelType) {
case TOP_COMPOSITION_START:
return eventTypes.compositionStart;
case TOP_COMPOSITION_END:
return eventTypes.compositionEnd;
case TOP_COMPOSITION_UPDATE:
return eventTypes.compositionUpdate;
}
}
/**
* Does our fallback best-guess model think this event signifies that
* composition has begun?
*
* @param {string} topLevelType
* @param {object} nativeEvent
* @return {boolean}
*/
function isFallbackCompositionStart(topLevelType, nativeEvent) {
return topLevelType === TOP_KEY_DOWN && nativeEvent.keyCode === START_KEYCODE;
}
/**
* Does our fallback mode think that this event is the end of composition?
*
* @param {string} topLevelType
* @param {object} nativeEvent
* @return {boolean}
*/
function isFallbackCompositionEnd(topLevelType, nativeEvent) {
switch (topLevelType) {
case TOP_KEY_UP:
// Command keys insert or clear IME input.
return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
case TOP_KEY_DOWN:
// Expect IME keyCode on each keydown. If we get any other
// code we must have exited earlier.
return nativeEvent.keyCode !== START_KEYCODE;
case TOP_KEY_PRESS:
case TOP_MOUSE_DOWN:
case TOP_BLUR:
// Events are not possible without cancelling IME.
return true;
default:
return false;
}
}
/**
* Google Input Tools provides composition data via a CustomEvent,
* with the `data` property populated in the `detail` object. If this
* is available on the event object, use it. If not, this is a plain
* composition event and we have nothing special to extract.
*
* @param {object} nativeEvent
* @return {?string}
*/
function getDataFromCustomEvent(nativeEvent) {
var detail = nativeEvent.detail;
if (typeof detail === 'object' && 'data' in detail) {
return detail.data;
}
return null;
}
/**
* Check if a composition event was triggered by Korean IME.
* Our fallback mode does not work well with IE's Korean IME,
* so just use native composition events when Korean IME is used.
* Although CompositionEvent.locale property is deprecated,
* it is available in IE, where our fallback mode is enabled.
*
* @param {object} nativeEvent
* @return {boolean}
*/
function isUsingKoreanIME(nativeEvent) {
return nativeEvent.locale === 'ko';
}
// Track the current IME composition status, if any.
var isComposing = false;
/**
* @return {?object} A SyntheticCompositionEvent.
*/
function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
var eventType = void 0;
var fallbackData = void 0;
if (canUseCompositionEvent) {
eventType = getCompositionEventType(topLevelType);
} else if (!isComposing) {
if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
eventType = eventTypes.compositionStart;
}
} else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
eventType = eventTypes.compositionEnd;
}
if (!eventType) {
return null;
}
if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {
// The current composition is stored statically and must not be
// overwritten while composition continues.
if (!isComposing && eventType === eventTypes.compositionStart) {
isComposing = initialize(nativeEventTarget);
} else if (eventType === eventTypes.compositionEnd) {
if (isComposing) {
fallbackData = getData();
}
}
}
var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
if (fallbackData) {
// Inject data generated from fallback path into the synthetic event.
// This matches the property of native CompositionEventInterface.
event.data = fallbackData;
} else {
var customData = getDataFromCustomEvent(nativeEvent);
if (customData !== null) {
event.data = customData;
}
}
accumulateTwoPhaseDispatches(event);
return event;
}
/**
* @param {TopLevelType} topLevelType Number from `TopLevelType`.
* @param {object} nativeEvent Native browser event.
* @return {?string} The string corresponding to this `beforeInput` event.
*/
function getNativeBeforeInputChars(topLevelType, nativeEvent) {
switch (topLevelType) {
case TOP_COMPOSITION_END:
return getDataFromCustomEvent(nativeEvent);
case TOP_KEY_PRESS:
/**
* If native `textInput` events are available, our goal is to make
* use of them. However, there is a special case: the spacebar key.
* In Webkit, preventing default on a spacebar `textInput` event
* cancels character insertion, but it *also* causes the browser
* to fall back to its default spacebar behavior of scrolling the
* page.
*
* Tracking at:
* https://code.google.com/p/chromium/issues/detail?id=355103
*
* To avoid this issue, use the keypress event as if no `textInput`
* event is available.
*/
var which = nativeEvent.which;
if (which !== SPACEBAR_CODE) {
return null;
}
hasSpaceKeypress = true;
return SPACEBAR_CHAR;
case TOP_TEXT_INPUT:
// Record the characters to be added to the DOM.
var chars = nativeEvent.data;
// If it's a spacebar character, assume that we have already handled
// it at the keypress level and bail immediately. Android Chrome
// doesn't give us keycodes, so we need to ignore it.
if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
return null;
}
return chars;
default:
// For other native event types, do nothing.
return null;
}
}
/**
* For browsers that do not provide the `textInput` event, extract the
* appropriate string to use for SyntheticInputEvent.
*
* @param {number} topLevelType Number from `TopLevelEventTypes`.
* @param {object} nativeEvent Native browser event.
* @return {?string} The fallback string for this `beforeInput` event.
*/
function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
// If we are currently composing (IME) and using a fallback to do so,
// try to extract the composed characters from the fallback object.
// If composition event is available, we extract a string only at
// compositionevent, otherwise extract it at fallback events.
if (isComposing) {
if (topLevelType === TOP_COMPOSITION_END || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {
var chars = getData();
reset();
isComposing = false;
return chars;
}
return null;
}
switch (topLevelType) {
case TOP_PASTE:
// If a paste event occurs after a keypress, throw out the input
// chars. Paste events should not lead to BeforeInput events.
return null;
case TOP_KEY_PRESS:
/**
* As of v27, Firefox may fire keypress events even when no character
* will be inserted. A few possibilities:
*
* - `which` is `0`. Arrow keys, Esc key, etc.
*
* - `which` is the pressed key code, but no char is available.
* Ex: 'AltGr + d` in Polish. There is no modified character for
* this key combination and no character is inserted into the
* document, but FF fires the keypress for char code `100` anyway.
* No `input` event will occur.
*
* - `which` is the pressed key code, but a command combination is
* being used. Ex: `Cmd+C`. No character is inserted, and no
* `input` event will occur.
*/
if (!isKeypressCommand(nativeEvent)) {
// IE fires the `keypress` event when a user types an emoji via
// Touch keyboard of Windows. In such a case, the `char` property
// holds an emoji character like `\uD83D\uDE0A`. Because its length
// is 2, the property `which` does not represent an emoji correctly.
// In such a case, we directly return the `char` property instead of
// using `which`.
if (nativeEvent.char && nativeEvent.char.length > 1) {
return nativeEvent.char;
} else if (nativeEvent.which) {
return String.fromCharCode(nativeEvent.which);
}
}
return null;
case TOP_COMPOSITION_END:
return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;
default:
return null;
}
}
/**
* Extract a SyntheticInputEvent for `beforeInput`, based on either native
* `textInput` or fallback behavior.
*
* @return {?object} A SyntheticInputEvent.
*/
function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
var chars = void 0;
if (canUseTextInputEvent) {
chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
} else {
chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
}
// If no characters are being inserted, no BeforeInput event should
// be fired.
if (!chars) {
return null;
}
var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);
event.data = chars;
accumulateTwoPhaseDispatches(event);
return event;
}
/**
* Create an `onBeforeInput` event to match
* http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
*
* This event plugin is based on the native `textInput` event
* available in Chrome, Safari, Opera, and IE. This event fires after
* `onKeyPress` and `onCompositionEnd`, but before `onInput`.
*
* `beforeInput` is spec'd but not implemented in any browsers, and
* the `input` event does not provide any useful information about what has
* actually been added, contrary to the spec. Thus, `textInput` is the best
* available event to identify the characters that have actually been inserted
* into the target node.
*
* This plugin is also responsible for emitting `composition` events, thus
* allowing us to share composition fallback code for both `beforeInput` and
* `composition` event types.
*/
var BeforeInputEventPlugin = {
eventTypes: eventTypes,
extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
var composition = extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);
var beforeInput = extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);
if (composition === null) {
return beforeInput;
}
if (beforeInput === null) {
return composition;
}
return [composition, beforeInput];
}
};
// Use to restore controlled state after a change event has fired.
var restoreImpl = null;
var restoreTarget = null;
var restoreQueue = null;
function restoreStateOfTarget(target) {
// We perform this translation at the end of the event loop so that we
// always receive the correct fiber here
var internalInstance = getInstanceFromNode(target);
if (!internalInstance) {
// Unmounted
return;
}
!(typeof restoreImpl === 'function') ? invariant(false, 'setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.') : void 0;
var props = getFiberCurrentPropsFromNode(internalInstance.stateNode);
restoreImpl(internalInstance.stateNode, internalInstance.type, props);
}
function setRestoreImplementation(impl) {
restoreImpl = impl;
}
function enqueueStateRestore(target) {
if (restoreTarget) {
if (restoreQueue) {
restoreQueue.push(target);
} else {
restoreQueue = [target];
}
} else {
restoreTarget = target;
}
}
function needsStateRestore() {
return restoreTarget !== null || restoreQueue !== null;
}
function restoreStateIfNeeded() {
if (!restoreTarget) {
return;
}
var target = restoreTarget;
var queuedTargets = restoreQueue;
restoreTarget = null;
restoreQueue = null;
restoreStateOfTarget(target);
if (queuedTargets) {
for (var i = 0; i < queuedTargets.length; i++) {
restoreStateOfTarget(queuedTargets[i]);
}
}
}
// Used as a way to call batchedUpdates when we don't have a reference to
// the renderer. Such as when we're dispatching events or if third party
// libraries need to call batchedUpdates. Eventually, this API will go away when
// everything is batched by default. We'll then have a similar API to opt-out of
// scheduled work and instead do synchronous work.
// Defaults
var _batchedUpdatesImpl = function (fn, bookkeeping) {
return fn(bookkeeping);
};
var _interactiveUpdatesImpl = function (fn, a, b) {
return fn(a, b);
};
var _flushInteractiveUpdatesImpl = function () {};
var isBatching = false;
function batchedUpdates(fn, bookkeeping) {
if (isBatching) {
// If we are currently inside another batch, we need to wait until it
// fully completes before restoring state.
return fn(bookkeeping);
}
isBatching = true;
try {
return _batchedUpdatesImpl(fn, bookkeeping);
} finally {
// Here we wait until all updates have propagated, which is important
// when using controlled components within layers:
// https://github.com/facebook/react/issues/1698
// Then we restore state of any controlled component.
isBatching = false;
var controlledComponentsHavePendingUpdates = needsStateRestore();
if (controlledComponentsHavePendingUpdates) {
// If a controlled event was fired, we may need to restore the state of
// the DOM node back to the controlled value. This is necessary when React
// bails out of the update without touching the DOM.
_flushInteractiveUpdatesImpl();
restoreStateIfNeeded();
}
}
}
function interactiveUpdates(fn, a, b) {
return _interactiveUpdatesImpl(fn, a, b);
}
function setBatchingImplementation(batchedUpdatesImpl, interactiveUpdatesImpl, flushInteractiveUpdatesImpl) {
_batchedUpdatesImpl = batchedUpdatesImpl;
_interactiveUpdatesImpl = interactiveUpdatesImpl;
_flushInteractiveUpdatesImpl = flushInteractiveUpdatesImpl;
}
/**
* @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
*/
var supportedInputTypes = {
color: true,
date: true,
datetime: true,
'datetime-local': true,
email: true,
month: true,
number: true,
password: true,
range: true,
search: true,
tel: true,
text: true,
time: true,
url: true,
week: true
};
function isTextInputElement(elem) {
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
if (nodeName === 'input') {
return !!supportedInputTypes[elem.type];
}
if (nodeName === 'textarea') {
return true;
}
return false;
}
/**
* HTML nodeType values that represent the type of the node
*/
var ELEMENT_NODE = 1;
var TEXT_NODE = 3;
var COMMENT_NODE = 8;
var DOCUMENT_NODE = 9;
var DOCUMENT_FRAGMENT_NODE = 11;
/**
* Gets the target node from a native browser event by accounting for
* inconsistencies in browser DOM APIs.
*
* @param {object} nativeEvent Native browser event.
* @return {DOMEventTarget} Target node.
*/
function getEventTarget(nativeEvent) {
// Fallback to nativeEvent.srcElement for IE9
// https://github.com/facebook/react/issues/12506
var target = nativeEvent.target || nativeEvent.srcElement || window;
// Normalize SVG <use> element events #4963
if (target.correspondingUseElement) {
target = target.correspondingUseElement;
}
// Safari may fire events on text nodes (Node.TEXT_NODE is 3).
// @see http://www.quirksmode.org/js/events_properties.html
return target.nodeType === TEXT_NODE ? target.parentNode : target;
}
/**
* Checks if an event is supported in the current execution environment.
*
* NOTE: This will not work correctly for non-generic events such as `change`,
* `reset`, `load`, `error`, and `select`.
*
* Borrows from Modernizr.
*
* @param {string} eventNameSuffix Event name, e.g. "click".
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/
function isEventSupported(eventNameSuffix) {
if (!canUseDOM) {
return false;
}
var eventName = 'on' + eventNameSuffix;
var isSupported = eventName in document;
if (!isSupported) {
var element = document.createElement('div');
element.setAttribute(eventName, 'return;');
isSupported = typeof element[eventName] === 'function';
}
return isSupported;
}
function isCheckable(elem) {
var type = elem.type;
var nodeName = elem.nodeName;
return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');
}
function getTracker(node) {
return node._valueTracker;
}
function detachTracker(node) {
node._valueTracker = null;
}
function getValueFromNode(node) {
var value = '';
if (!node) {
return value;
}
if (isCheckable(node)) {
value = node.checked ? 'true' : 'false';
} else {
value = node.value;
}
return value;
}
function trackValueOnNode(node) {
var valueField = isCheckable(node) ? 'checked' : 'value';
var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
var currentValue = '' + node[valueField];
// if someone has already defined a value or Safari, then bail
// and don't track value will cause over reporting of changes,
// but it's better then a hard failure
// (needed for certain tests that spyOn input values and Safari)
if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {
return;
}
var get = descriptor.get,
set = descriptor.set;
Object.defineProperty(node, valueField, {
configurable: true,
get: function () {
return get.call(this);
},
set: function (value) {
currentValue = '' + value;
set.call(this, value);
}
});
// We could've passed this the first time
// but it triggers a bug in IE11 and Edge 14/15.
// Calling defineProperty() again should be equivalent.
// https://github.com/facebook/react/issues/11768
Object.defineProperty(node, valueField, {
enumerable: descriptor.enumerable
});
var tracker = {
getValue: function () {
return currentValue;
},
setValue: function (value) {
currentValue = '' + value;
},
stopTracking: function () {
detachTracker(node);
delete node[valueField];
}
};
return tracker;
}
function track(node) {
if (getTracker(node)) {
return;
}
// TODO: Once it's just Fiber we can move this to node._wrapperState
node._valueTracker = trackValueOnNode(node);
}
function updateValueIfChanged(node) {
if (!node) {
return false;
}
var tracker = getTracker(node);
// if there is no tracker at this point it's unlikely
// that trying again will succeed
if (!tracker) {
return true;
}
var lastValue = tracker.getValue();
var nextValue = getValueFromNode(node);
if (nextValue !== lastValue) {
tracker.setValue(nextValue);
return true;
}
return false;
}
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
var describeComponentFrame = function (name, source, ownerName) {
var sourceInfo = '';
if (source) {
var path = source.fileName;
var fileName = path.replace(BEFORE_SLASH_RE, '');
{
// In DEV, include code for a common special case:
// prefer "folder/index.js" instead of just "index.js".
if (/^index\./.test(fileName)) {
var match = path.match(BEFORE_SLASH_RE);
if (match) {
var pathBeforeSlash = match[1];
if (pathBeforeSlash) {
var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
fileName = folderName + '/' + fileName;
}
}
}
}
sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
} else if (ownerName) {
sourceInfo = ' (created by ' + ownerName + ')';
}
return '\n in ' + (name || 'Unknown') + sourceInfo;
};
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator';
function getIteratorFn(maybeIterable) {
if (maybeIterable === null || typeof maybeIterable !== 'object') {
return null;
}
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
if (typeof maybeIterator === 'function') {
return maybeIterator;
}
return null;
}
var Pending = 0;
var Resolved = 1;
var Rejected = 2;
function refineResolvedLazyComponent(lazyComponent) {
return lazyComponent._status === Resolved ? lazyComponent._result : null;
}
function getWrappedName(outerType, innerType, wrapperName) {
var functionName = innerType.displayName || innerType.name || '';
return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName);
}
function getComponentName(type) {
if (type == null) {
// Host root, text node or just invalid type.
return null;
}
{
if (typeof type.tag === 'number') {
warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
}
}
if (typeof type === 'function') {
return type.displayName || type.name || null;
}
if (typeof type === 'string') {
return type;
}
switch (type) {
case REACT_CONCURRENT_MODE_TYPE:
return 'ConcurrentMode';
case REACT_FRAGMENT_TYPE:
return 'Fragment';
case REACT_PORTAL_TYPE:
return 'Portal';
case REACT_PROFILER_TYPE:
return 'Profiler';
case REACT_STRICT_MODE_TYPE:
return 'StrictMode';
case REACT_SUSPENSE_TYPE:
return 'Suspense';
}
if (typeof type === 'object') {
switch (type.$$typeof) {
case REACT_CONTEXT_TYPE:
return 'Context.Consumer';
case REACT_PROVIDER_TYPE:
return 'Context.Provider';
case REACT_FORWARD_REF_TYPE:
return getWrappedName(type, type.render, 'ForwardRef');
case REACT_MEMO_TYPE:
return getComponentName(type.type);
case REACT_LAZY_TYPE:
{
var thenable = type;
var resolvedThenable = refineResolvedLazyComponent(thenable);
if (resolvedThenable) {
return getComponentName(resolvedThenable);
}
}
}
}
return null;
}
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
function describeFiber(fiber) {
switch (fiber.tag) {
case HostRoot:
case HostPortal:
case HostText:
case Fragment:
case ContextProvider:
case ContextConsumer:
return '';
default:
var owner = fiber._debugOwner;
var source = fiber._debugSource;
var name = getComponentName(fiber.type);
var ownerName = null;
if (owner) {
ownerName = getComponentName(owner.type);
}
return describeComponentFrame(name, source, ownerName);
}
}
function getStackByFiberInDevAndProd(workInProgress) {
var info = '';
var node = workInProgress;
do {
info += describeFiber(node);
node = node.return;
} while (node);
return info;
}
var current = null;
var phase = null;
function getCurrentFiberOwnerNameInDevOrNull() {
{
if (current === null) {
return null;
}
var owner = current._debugOwner;
if (owner !== null && typeof owner !== 'undefined') {
return getComponentName(owner.type);
}
}
return null;
}
function getCurrentFiberStackInDev() {
{
if (current === null) {
return '';
}
// Safe because if current fiber exists, we are reconciling,
// and it is guaranteed to be the work-in-progress version.
return getStackByFiberInDevAndProd(current);
}
return '';
}
function resetCurrentFiber() {
{
ReactDebugCurrentFrame.getCurrentStack = null;
current = null;
phase = null;
}
}
function setCurrentFiber(fiber) {
{
ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev;
current = fiber;
phase = null;
}
}
function setCurrentPhase(lifeCyclePhase) {
{
phase = lifeCyclePhase;
}
}
/**
* Similar to invariant but only logs a warning if the condition is not met.
* This can be used to log issues in development environments in critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
var warning = warningWithoutStack$1;
{
warning = function (condition, format) {
if (condition) {
return;
}
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
var stack = ReactDebugCurrentFrame.getStackAddendum();
// eslint-disable-next-line react-internal/warning-and-invariant-args
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
args[_key - 2] = arguments[_key];
}
warningWithoutStack$1.apply(undefined, [false, format + '%s'].concat(args, [stack]));
};
}
var warning$1 = warning;
// A reserved attribute.
// It is handled by React separately and shouldn't be written to the DOM.
var RESERVED = 0;
// A simple string attribute.
// Attributes that aren't in the whitelist are presumed to have this type.
var STRING = 1;
// A string attribute that accepts booleans in React. In HTML, these are called
// "enumerated" attributes with "true" and "false" as possible values.
// When true, it should be set to a "true" string.
// When false, it should be set to a "false" string.
var BOOLEANISH_STRING = 2;
// A real boolean attribute.
// When true, it should be present (set either to an empty string or its name).
// When false, it should be omitted.
var BOOLEAN = 3;
// An attribute that can be used as a flag as well as with a value.
// When true, it should be present (set either to an empty string or its name).
// When false, it should be omitted.
// For any other value, should be present with that value.
var OVERLOADED_BOOLEAN = 4;
// An attribute that must be numeric or parse as a numeric.
// When falsy, it should be removed.
var NUMERIC = 5;
// An attribute that must be positive numeric or parse as a positive numeric.
// When falsy, it should be removed.
var POSITIVE_NUMERIC = 6;
/* eslint-disable max-len */
var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
/* eslint-enable max-len */
var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040';
var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');
var hasOwnProperty = Object.prototype.hasOwnProperty;
var illegalAttributeNameCache = {};
var validatedAttributeNameCache = {};
function isAttributeNameSafe(attributeName) {
if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
return true;
}
if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
return false;
}
if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
validatedAttributeNameCache[attributeName] = true;
return true;
}
illegalAttributeNameCache[attributeName] = true;
{
warning$1(false, 'Invalid attribute name: `%s`', attributeName);
}
return false;
}
function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
if (propertyInfo !== null) {
return propertyInfo.type === RESERVED;
}
if (isCustomComponentTag) {
return false;
}
if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
return true;
}
return false;
}
function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
if (propertyInfo !== null && propertyInfo.type === RESERVED) {
return false;
}
switch (typeof value) {
case 'function':
// $FlowIssue symbol is perfectly valid here
case 'symbol':
// eslint-disable-line
return true;
case 'boolean':
{
if (isCustomComponentTag) {
return false;
}
if (propertyInfo !== null) {
return !propertyInfo.acceptsBooleans;
} else {
var prefix = name.toLowerCase().slice(0, 5);
return prefix !== 'data-' && prefix !== 'aria-';
}
}
default:
return false;
}
}
function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
if (value === null || typeof value === 'undefined') {
return true;
}
if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
return true;
}
if (isCustomComponentTag) {
return false;
}
if (propertyInfo !== null) {
switch (propertyInfo.type) {
case BOOLEAN:
return !value;
case OVERLOADED_BOOLEAN:
return value === false;
case NUMERIC:
return isNaN(value);
case POSITIVE_NUMERIC:
return isNaN(value) || value < 1;
}
}
return false;
}
function getPropertyInfo(name) {
return properties.hasOwnProperty(name) ? properties[name] : null;
}
function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace) {
this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
this.attributeName = attributeName;
this.attributeNamespace = attributeNamespace;
this.mustUseProperty = mustUseProperty;
this.propertyName = name;
this.type = type;
}
// When adding attributes to this list, be sure to also add them to
// the `possibleStandardNames` module to ensure casing and incorrect
// name warnings.
var properties = {};
// These props are reserved by React. They shouldn't be written to the DOM.
['children', 'dangerouslySetInnerHTML',
// TODO: This prevents the assignment of defaultValue to regular
// elements (not just inputs). Now that ReactDOMInput assigns to the
// defaultValue property -- do we need this?
'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) {
properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
name, // attributeName
null);
} // attributeNamespace
);
// A few React string attributes have a different name.
// This is a mapping from React prop names to the attribute names.
[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
var name = _ref[0],
attributeName = _ref[1];
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
attributeName, // attributeName
null);
} // attributeNamespace
);
// These are "enumerated" HTML attributes that accept "true" and "false".
// In React, we let users pass `true` and `false` even though technically
// these aren't boolean attributes (they are coerced to strings).
['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
name.toLowerCase(), // attributeName
null);
} // attributeNamespace
);
// These are "enumerated" SVG attributes that accept "true" and "false".
// In React, we let users pass `true` and `false` even though technically
// these aren't boolean attributes (they are coerced to strings).
// Since these are SVG attributes, their attribute names are case-sensitive.
['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
name, // attributeName
null);
} // attributeNamespace
);
// These are HTML boolean attributes.
['allowFullScreen', 'async',
// Note: there is a special case that prevents it from being written to the DOM
// on the client side because the browsers are inconsistent. Instead we call focus().
'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless',
// Microdata
'itemScope'].forEach(function (name) {
properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty
name.toLowerCase(), // attributeName
null);
} // attributeNamespace
);
// These are the few React props that we set as DOM properties
// rather than attributes. These are all booleans.
['checked',
// Note: `option.selected` is not updated if `select.multiple` is
// disabled with `removeAttribute`. We have special logic for handling this.
'multiple', 'muted', 'selected'].forEach(function (name) {
properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
name, // attributeName
null);
} // attributeNamespace
);
// These are HTML attributes that are "overloaded booleans": they behave like
// booleans, but can also accept a string value.
['capture', 'download'].forEach(function (name) {
properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
name, // attributeName
null);
} // attributeNamespace
);
// These are HTML attributes that must be positive numbers.
['cols', 'rows', 'size', 'span'].forEach(function (name) {
properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
name, // attributeName
null);
} // attributeNamespace
);
// These are HTML attributes that must be numbers.
['rowSpan', 'start'].forEach(function (name) {
properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty
name.toLowerCase(), // attributeName
null);
} // attributeNamespace
);
var CAMELIZE = /[\-\:]([a-z])/g;
var capitalize = function (token) {
return token[1].toUpperCase();
};
// This is a list of all SVG attributes that need special casing, namespacing,
// or boolean value assignment. Regular attributes that just accept strings
// and have the same names are omitted, just like in the HTML whitelist.
// Some of these attributes can be hard to find. This list was created by
// scrapping the MDN documentation.
['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height'].forEach(function (attributeName) {
var name = attributeName.replace(CAMELIZE, capitalize);
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
attributeName, null);
} // attributeNamespace
);
// String SVG attributes with the xlink namespace.
['xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) {
var name = attributeName.replace(CAMELIZE, capitalize);
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
attributeName, 'http://www.w3.org/1999/xlink');
});
// String SVG attributes with the xml namespace.
['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) {
var name = attributeName.replace(CAMELIZE, capitalize);
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
attributeName, 'http://www.w3.org/XML/1998/namespace');
});
// Special case: this attribute exists both in HTML and SVG.
// Its "tabindex" attribute name is case-sensitive in SVG so we can't just use
// its React `tabIndex` name, like we do for attributes that exist only in HTML.
properties.tabIndex = new PropertyInfoRecord('tabIndex', STRING, false, // mustUseProperty
'tabindex', // attributeName
null);
/**
* Get the value for a property on a node. Only used in DEV for SSR validation.
* The "expected" argument is used as a hint of what the expected value is.
* Some properties have multiple equivalent values.
*/
function getValueForProperty(node, name, expected, propertyInfo) {
{
if (propertyInfo.mustUseProperty) {
var propertyName = propertyInfo.propertyName;
return node[propertyName];
} else {
var attributeName = propertyInfo.attributeName;
var stringValue = null;
if (propertyInfo.type === OVERLOADED_BOOLEAN) {
if (node.hasAttribute(attributeName)) {
var value = node.getAttribute(attributeName);
if (value === '') {
return true;
}
if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
return value;
}
if (value === '' + expected) {
return expected;
}
return value;
}
} else if (node.hasAttribute(attributeName)) {
if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
// We had an attribute but shouldn't have had one, so read it
// for the error message.
return node.getAttribute(attributeName);
}
if (propertyInfo.type === BOOLEAN) {
// If this was a boolean, it doesn't matter what the value is
// the fact that we have it is the same as the expected.
return expected;
}
// Even if this property uses a namespace we use getAttribute
// because we assume its namespaced name is the same as our config.
// To use getAttributeNS we need the local name which we don't have
// in our config atm.
stringValue = node.getAttribute(attributeName);
}
if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
return stringValue === null ? expected : stringValue;
} else if (stringValue === '' + expected) {
return expected;
} else {
return stringValue;
}
}
}
}
/**
* Get the value for a attribute on a node. Only used in DEV for SSR validation.
* The third argument is used as a hint of what the expected value is. Some
* attributes have multiple equivalent values.
*/
function getValueForAttribute(node, name, expected) {
{
if (!isAttributeNameSafe(name)) {
return;
}
if (!node.hasAttribute(name)) {
return expected === undefined ? undefined : null;
}
var value = node.getAttribute(name);
if (value === '' + expected) {
return expected;
}
return value;
}
}
/**
* Sets the value for a property on a node.
*
* @param {DOMElement} node
* @param {string} name
* @param {*} value
*/
function setValueForProperty(node, name, value, isCustomComponentTag) {
var propertyInfo = getPropertyInfo(name);
if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {
return;
}
if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {
value = null;
}
// If the prop isn't in the special list, treat it as a simple attribute.
if (isCustomComponentTag || propertyInfo === null) {
if (isAttributeNameSafe(name)) {
var _attributeName = name;
if (value === null) {
node.removeAttribute(_attributeName);
} else {
node.setAttribute(_attributeName, '' + value);
}
}
return;
}
var mustUseProperty = propertyInfo.mustUseProperty;
if (mustUseProperty) {
var propertyName = propertyInfo.propertyName;
if (value === null) {
var type = propertyInfo.type;
node[propertyName] = type === BOOLEAN ? false : '';
} else {
// Contrary to `setAttribute`, object properties are properly
// `toString`ed by IE8/9.
node[propertyName] = value;
}
return;
}
// The rest are treated as attributes with special cases.
var attributeName = propertyInfo.attributeName,
attributeNamespace = propertyInfo.attributeNamespace;
if (value === null) {
node.removeAttribute(attributeName);
} else {
var _type = propertyInfo.type;
var attributeValue = void 0;
if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
attributeValue = '';
} else {
// `setAttribute` with objects becomes only `[object]` in IE8/9,
// ('' + value) makes it output the correct toString()-value.
attributeValue = '' + value;
}
if (attributeNamespace) {
node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
} else {
node.setAttribute(attributeName, attributeValue);
}
}
}
// Flow does not allow string concatenation of most non-string types. To work
// around this limitation, we use an opaque type that can only be obtained by
// passing the value through getToStringValue first.
function toString(value) {
return '' + value;
}
function getToStringValue(value) {
switch (typeof value) {
case 'boolean':
case 'number':
case 'object':
case 'string':
case 'undefined':
return value;
default:
// function, symbol are assigned as empty strings
return '';
}
}
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var printWarning = function() {};
{
var ReactPropTypesSecret = ReactPropTypesSecret_1;
var loggedTypeFailures = {};
printWarning = function(text) {
var message = 'Warning: ' + text;
if (typeof console !== 'undefined') {
console.error(message);
}
try {
// --- Welcome to debugging React ---
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch (x) {}
};
}
/**
* Assert that the values match with the type specs.
* Error messages are memorized and will only be shown once.
*
* @param {object} typeSpecs Map of name to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @param {string} componentName Name of the component for error messages.
* @param {?Function} getStack Returns the component stack.
* @private
*/
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
{
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
var error;
// Prop type validation may throw. In case they do, we don't want to
// fail the render phase where it didn't fail before. So we log it.
// After these have been cleaned up, we'll let them throw.
try {
// This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message.
if (typeof typeSpecs[typeSpecName] !== 'function') {
var err = Error(
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
);
err.name = 'Invariant Violation';
throw err;
}
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
} catch (ex) {
error = ex;
}
if (error && !(error instanceof Error)) {
printWarning(
(componentName || 'React class') + ': type specification of ' +
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
'You may have forgotten to pass an argument to the type checker ' +
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
'shape all require an argument).'
);
}
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var stack = getStack ? getStack() : '';
printWarning(
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
);
}
}
}
}
}
var checkPropTypes_1 = checkPropTypes;
var ReactDebugCurrentFrame$1 = null;
var ReactControlledValuePropTypes = {
checkPropTypes: null
};
{
ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
var hasReadOnlyValue = {
button: true,
checkbox: true,
image: true,
hidden: true,
radio: true,
reset: true,
submit: true
};
var propTypes = {
value: function (props, propName, componentName) {
if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null) {
return null;
}
return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
},
checked: function (props, propName, componentName) {
if (props.onChange || props.readOnly || props.disabled || props[propName] == null) {
return null;
}
return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
}
};
/**
* Provide a linked `value` attribute for controlled forms. You should not use
* this outside of the ReactDOM controlled form components.
*/
ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {
checkPropTypes_1(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$1.getStackAddendum);
};
}
var enableUserTimingAPI = true;
var enableHooks = false;
// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
var debugRenderPhaseSideEffects = false;
// In some cases, StrictMode should also double-render lifecycles.
// This can be confusing for tests though,
// And it can be bad for performance in production.
// This feature flag can be used to control the behavior:
var debugRenderPhaseSideEffectsForStrictMode = true;
// To preserve the "Pause on caught exceptions" behavior of the debugger, we
// replay the begin phase of a failed component inside invokeGuardedCallback.
var replayFailedUnitOfWorkWithInvokeGuardedCallback = true;
// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
var warnAboutDeprecatedLifecycles = false;
// Gather advanced timing metrics for Profiler subtrees.
var enableProfilerTimer = true;
// Trace which interactions trigger each commit.
var enableSchedulerTracing = true;
// Only used in www builds.
// TODO: true? Here it might just be false.
// Only used in www builds.
// Only used in www builds.
// React Fire: prevent the value and checked attributes from syncing
// with their related DOM properties
var disableInputAttributeSyncing = false;
// These APIs will no longer be "unstable" in the upcoming 16.7 release,
// Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
var enableStableConcurrentModeAPIs = false;
var warnAboutShorthandPropertyCollision = false;
// TODO: direct imports like some-package/src/* are bad. Fix me.
var didWarnValueDefaultValue = false;
var didWarnCheckedDefaultChecked = false;
var didWarnControlledToUncontrolled = false;
var didWarnUncontrolledToControlled = false;
function isControlled(props) {
var usesChecked = props.type === 'checkbox' || props.type === 'radio';
return usesChecked ? props.checked != null : props.value != null;
}
/**
* Implements an <input> host component that allows setting these optional
* props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
*
* If `checked` or `value` are not supplied (or null/undefined), user actions
* that affect the checked state or value will trigger updates to the element.
*
* If they are supplied (and not null/undefined), the rendered element will not
* trigger updates to the element. Instead, the props must change in order for
* the rendered element to be updated.
*
* The rendered element will be initialized as unchecked (or `defaultChecked`)
* with an empty value (or `defaultValue`).
*
* See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
*/
function getHostProps(element, props) {
var node = element;
var checked = props.checked;
var hostProps = _assign({}, props, {
defaultChecked: undefined,
defaultValue: undefined,
value: undefined,
checked: checked != null ? checked : node._wrapperState.initialChecked
});
return hostProps;
}
function initWrapperState(element, props) {
{
ReactControlledValuePropTypes.checkPropTypes('input', props);
if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
warning$1(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
didWarnCheckedDefaultChecked = true;
}
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
warning$1(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
didWarnValueDefaultValue = true;
}
}
var node = element;
var defaultValue = props.defaultValue == null ? '' : props.defaultValue;
node._wrapperState = {
initialChecked: props.checked != null ? props.checked : props.defaultChecked,
initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
controlled: isControlled(props)
};
}
function updateChecked(element, props) {
var node = element;
var checked = props.checked;
if (checked != null) {
setValueForProperty(node, 'checked', checked, false);
}
}
function updateWrapper(element, props) {
var node = element;
{
var _controlled = isControlled(props);
if (!node._wrapperState.controlled && _controlled && !didWarnUncontrolledToControlled) {
warning$1(false, 'A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);
didWarnUncontrolledToControlled = true;
}
if (node._wrapperState.controlled && !_controlled && !didWarnControlledToUncontrolled) {
warning$1(false, 'A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);
didWarnControlledToUncontrolled = true;
}
}
updateChecked(element, props);
var value = getToStringValue(props.value);
var type = props.type;
if (value != null) {
if (type === 'number') {
if (value === 0 && node.value === '' ||
// We explicitly want to coerce to number here if possible.
// eslint-disable-next-line
node.value != value) {
node.value = toString(value);
}
} else if (node.value !== toString(value)) {
node.value = toString(value);
}
} else if (type === 'submit' || type === 'reset') {
// Submit/reset inputs need the attribute removed completely to avoid
// blank-text buttons.
node.removeAttribute('value');
return;
}
if (disableInputAttributeSyncing) {
// When not syncing the value attribute, React only assigns a new value
// whenever the defaultValue React prop has changed. When not present,
// React does nothing
if (props.hasOwnProperty('defaultValue')) {
setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
}
} else {
// When syncing the value attribute, the value comes from a cascade of
// properties:
// 1. The value React property
// 2. The defaultValue React property
// 3. Otherwise there should be no change
if (props.hasOwnProperty('value')) {
setDefaultValue(node, props.type, value);
} else if (props.hasOwnProperty('defaultValue')) {
setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
}
}
if (disableInputAttributeSyncing) {
// When not syncing the checked attribute, the attribute is directly
// controllable from the defaultValue React property. It needs to be
// updated as new props come in.
if (props.defaultChecked == null) {
node.removeAttribute('checked');
} else {
node.defaultChecked = !!props.defaultChecked;
}
} else {
// When syncing the checked attribute, it only changes when it needs
// to be removed, such as transitioning from a checkbox into a text input
if (props.checked == null && props.defaultChecked != null) {
node.defaultChecked = !!props.defaultChecked;
}
}
}
function postMountWrapper(element, props, isHydrating) {
var node = element;
// Do not assign value if it is already set. This prevents user text input
// from being lost during SSR hydration.
if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) {
var type = props.type;
var isButton = type === 'submit' || type === 'reset';
// Avoid setting value attribute on submit/reset inputs as it overrides the
// default value provided by the browser. See: #12872
if (isButton && (props.value === undefined || props.value === null)) {
return;
}
var _initialValue = toString(node._wrapperState.initialValue);
// Do not assign value if it is already set. This prevents user text input
// from being lost during SSR hydration.
if (!isHydrating) {
if (disableInputAttributeSyncing) {
var value = getToStringValue(props.value);
// When not syncing the value attribute, the value property points
// directly to the React prop. Only assign it if it exists.
if (value != null) {
// Always assign on buttons so that it is possible to assign an
// empty string to clear button text.
//
// Otherwise, do not re-assign the value property if is empty. This
// potentially avoids a DOM write and prevents Firefox (~60.0.1) from
// prematurely marking required inputs as invalid. Equality is compared
// to the current value in case the browser provided value is not an
// empty string.
if (isButton || value !== node.value) {
node.value = toString(value);
}
}
} else {
// When syncing the value attribute, the value property should use
// the wrapperState._initialValue property. This uses:
//
// 1. The value React property when present
// 2. The defaultValue React property when present
// 3. An empty string
if (_initialValue !== node.value) {
node.value = _initialValue;
}
}
}
if (disableInputAttributeSyncing) {
// When not syncing the value attribute, assign the value attribute
// directly from the defaultValue React property (when present)
var defaultValue = getToStringValue(props.defaultValue);
if (defaultValue != null) {
node.defaultValue = toString(defaultValue);
}
} else {
// Otherwise, the value attribute is synchronized to the property,
// so we assign defaultValue to the same thing as the value property
// assignment step above.
node.defaultValue = _initialValue;
}
}
// Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
// this is needed to work around a chrome bug where setting defaultChecked
// will sometimes influence the value of checked (even after detachment).
// Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416
// We need to temporarily unset name to avoid disrupting radio button groups.
var name = node.name;
if (name !== '') {
node.name = '';
}
if (disableInputAttributeSyncing) {
// When not syncing the checked attribute, the checked property
// never gets assigned. It must be manually set. We don't want
// to do this when hydrating so that existing user input isn't
// modified
if (!isHydrating) {
updateChecked(element, props);
}
// Only assign the checked attribute if it is defined. This saves
// a DOM write when controlling the checked attribute isn't needed
// (text inputs, submit/reset)
if (props.hasOwnProperty('defaultChecked')) {
node.defaultChecked = !node.defaultChecked;
node.defaultChecked = !!props.defaultChecked;
}
} else {
// When syncing the checked attribute, both the checked property and
// attribute are assigned at the same time using defaultChecked. This uses:
//
// 1. The checked React property when present
// 2. The defaultChecked React property when present
// 3. Otherwise, false
node.defaultChecked = !node.defaultChecked;
node.defaultChecked = !!node._wrapperState.initialChecked;
}
if (name !== '') {
node.name = name;
}
}
function restoreControlledState(element, props) {
var node = element;
updateWrapper(node, props);
updateNamedCousins(node, props);
}
function updateNamedCousins(rootNode, props) {
var name = props.name;
if (props.type === 'radio' && name != null) {
var queryRoot = rootNode;
while (queryRoot.parentNode) {
queryRoot = queryRoot.parentNode;
}
// If `rootNode.form` was non-null, then we could try `form.elements`,
// but that sometimes behaves strangely in IE8. We could also try using
// `form.getElementsByName`, but that will only return direct children
// and won't include inputs that use the HTML5 `form=` attribute. Since
// the input might not even be in a form. It might not even be in the
// document. Let's just use the local `querySelectorAll` to ensure we don't
// miss anything.
var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
for (var i = 0; i < group.length; i++) {
var otherNode = group[i];
if (otherNode === rootNode || otherNode.form !== rootNode.form) {
continue;
}
// This will throw if radio buttons rendered by different copies of React
// and the same name are rendered into the same form (same as #1939).
// That's probably okay; we don't support it just as we don't support
// mixing React radio buttons with non-React ones.
var otherProps = getFiberCurrentPropsFromNode$1(otherNode);
!otherProps ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.') : void 0;
// We need update the tracked value on the named cousin since the value
// was changed but the input saw no event or value set
updateValueIfChanged(otherNode);
// If this is a controlled radio button group, forcing the input that
// was previously checked to update will cause it to be come re-checked
// as appropriate.
updateWrapper(otherNode, otherProps);
}
}
}
// In Chrome, assigning defaultValue to certain input types triggers input validation.
// For number inputs, the display value loses trailing decimal points. For email inputs,
// Chrome raises "The specified value <x> is not a valid email address".
//
// Here we check to see if the defaultValue has actually changed, avoiding these problems
// when the user is inputting text
//
// https://github.com/facebook/react/issues/7253
function setDefaultValue(node, type, value) {
if (
// Focused number inputs synchronize on blur. See ChangeEventPlugin.js
type !== 'number' || node.ownerDocument.activeElement !== node) {
if (value == null) {
node.defaultValue = toString(node._wrapperState.initialValue);
} else if (node.defaultValue !== toString(value)) {
node.defaultValue = toString(value);
}
}
}
var eventTypes$1 = {
change: {
phasedRegistrationNames: {
bubbled: 'onChange',
captured: 'onChangeCapture'
},
dependencies: [TOP_BLUR, TOP_CHANGE, TOP_CLICK, TOP_FOCUS, TOP_INPUT, TOP_KEY_DOWN, TOP_KEY_UP, TOP_SELECTION_CHANGE]
}
};
function createAndAccumulateChangeEvent(inst, nativeEvent, target) {
var event = SyntheticEvent.getPooled(eventTypes$1.change, inst, nativeEvent, target);
event.type = 'change';
// Flag this event loop as needing state restore.
enqueueStateRestore(target);
accumulateTwoPhaseDispatches(event);
return event;
}
/**
* For IE shims
*/
var activeElement = null;
var activeElementInst = null;
/**
* SECTION: handle `change` event
*/
function shouldUseChangeEvent(elem) {
var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
}
function manualDispatchChangeEvent(nativeEvent) {
var event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent));
// If change and propertychange bubbled, we'd just bind to it like all the
// other events and have it go through ReactBrowserEventEmitter. Since it
// doesn't, we manually listen for the events and so we have to enqueue and
// process the abstract event manually.
//
// Batching is necessary here in order to ensure that all event handlers run
// before the next rerender (including event handlers attached to ancestor
// elements instead of directly on the input). Without this, controlled
// components don't work properly in conjunction with event bubbling because
// the component is rerendered and the value reverted before all the event
// handlers can run. See https://github.com/facebook/react/issues/708.
batchedUpdates(runEventInBatch, event);
}
function runEventInBatch(event) {
runEventsInBatch(event);
}
function getInstIfValueChanged(targetInst) {
var targetNode = getNodeFromInstance$1(targetInst);
if (updateValueIfChanged(targetNode)) {
return targetInst;
}
}
function getTargetInstForChangeEvent(topLevelType, targetInst) {
if (topLevelType === TOP_CHANGE) {
return targetInst;
}
}
/**
* SECTION: handle `input` event
*/
var isInputEventSupported = false;
if (canUseDOM) {
// IE9 claims to support the input event but fails to trigger it when
// deleting text, so we ignore its input events.
isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9);
}
/**
* (For IE <=9) Starts tracking propertychange events on the passed-in element
* and override the value property so that we can distinguish user events from
* value changes in JS.
*/
function startWatchingForValueChange(target, targetInst) {
activeElement = target;
activeElementInst = targetInst;
activeElement.attachEvent('onpropertychange', handlePropertyChange);
}
/**
* (For IE <=9) Removes the event listeners from the currently-tracked element,
* if any exists.
*/
function stopWatchingForValueChange() {
if (!activeElement) {
return;
}
activeElement.detachEvent('onpropertychange', handlePropertyChange);
activeElement = null;
activeElementInst = null;
}
/**
* (For IE <=9) Handles a propertychange event, sending a `change` event if
* the value of the active element has changed.
*/
function handlePropertyChange(nativeEvent) {
if (nativeEvent.propertyName !== 'value') {
return;
}
if (getInstIfValueChanged(activeElementInst)) {
manualDispatchChangeEvent(nativeEvent);
}
}
function handleEventsForInputEventPolyfill(topLevelType, target, targetInst) {
if (topLevelType === TOP_FOCUS) {
// In IE9, propertychange fires for most input events but is buggy and
// doesn't fire when text is deleted, but conveniently, selectionchange
// appears to fire in all of the remaining cases so we catch those and
// forward the event if the value has changed
// In either case, we don't want to call the event handler if the value
// is changed from JS so we redefine a setter for `.value` that updates
// our activeElementValue variable, allowing us to ignore those changes
//
// stopWatching() should be a noop here but we call it just in case we
// missed a blur event somehow.
stopWatchingForValueChange();
startWatchingForValueChange(target, targetInst);
} else if (topLevelType === TOP_BLUR) {
stopWatchingForValueChange();
}
}
// For IE8 and IE9.
function getTargetInstForInputEventPolyfill(topLevelType, targetInst) {
if (topLevelType === TOP_SELECTION_CHANGE || topLevelType === TOP_KEY_UP || topLevelType === TOP_KEY_DOWN) {
// On the selectionchange event, the target is just document which isn't
// helpful for us so just check activeElement instead.
//
// 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
// propertychange on the first input event after setting `value` from a
// script and fires only keydown, keypress, keyup. Catching keyup usually
// gets it and catching keydown lets us fire an event for the first
// keystroke if user does a key repeat (it'll be a little delayed: right
// before the second keystroke). Other input methods (e.g., paste) seem to
// fire selectionchange normally.
return getInstIfValueChanged(activeElementInst);
}
}
/**
* SECTION: handle `click` event
*/
function shouldUseClickEvent(elem) {
// Use the `click` event to detect changes to checkbox and radio inputs.
// This approach works across all browsers, whereas `change` does not fire
// until `blur` in IE8.
var nodeName = elem.nodeName;
return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
}
function getTargetInstForClickEvent(topLevelType, targetInst) {
if (topLevelType === TOP_CLICK) {
return getInstIfValueChanged(targetInst);
}
}
function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {
if (topLevelType === TOP_INPUT || topLevelType === TOP_CHANGE) {
return getInstIfValueChanged(targetInst);
}
}
function handleControlledInputBlur(node) {
var state = node._wrapperState;
if (!state || !state.controlled || node.type !== 'number') {
return;
}
if (!disableInputAttributeSyncing) {
// If controlled, assign the value attribute to the current value on blur
setDefaultValue(node, 'number', node.value);
}
}
/**
* This plugin creates an `onChange` event that normalizes change events
* across form elements. This event fires at a time when it's possible to
* change the element's value without seeing a flicker.
*
* Supported elements are:
* - input (see `isTextInputElement`)
* - textarea
* - select
*/
var ChangeEventPlugin = {
eventTypes: eventTypes$1,
_isInputEventSupported: isInputEventSupported,
extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;
var getTargetInstFunc = void 0,
handleEventFunc = void 0;
if (shouldUseChangeEvent(targetNode)) {
getTargetInstFunc = getTargetInstForChangeEvent;
} else if (isTextInputElement(targetNode)) {
if (isInputEventSupported) {
getTargetInstFunc = getTargetInstForInputOrChangeEvent;
} else {
getTargetInstFunc = getTargetInstForInputEventPolyfill;
handleEventFunc = handleEventsForInputEventPolyfill;
}
} else if (shouldUseClickEvent(targetNode)) {
getTargetInstFunc = getTargetInstForClickEvent;
}
if (getTargetInstFunc) {
var inst = getTargetInstFunc(topLevelType, targetInst);
if (inst) {
var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget);
return event;
}
}
if (handleEventFunc) {
handleEventFunc(topLevelType, targetNode, targetInst);
}
// When blurring, set the value attribute for number inputs
if (topLevelType === TOP_BLUR) {
handleControlledInputBlur(targetNode);
}
}
};
/**
* Module that is injectable into `EventPluginHub`, that specifies a
* deterministic ordering of `EventPlugin`s. A convenient way to reason about
* plugins, without having to package every one of them. This is better than
* having plugins be ordered in the same order that they are injected because
* that ordering would be influenced by the packaging order.
* `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
* preventing default on events is convenient in `SimpleEventPlugin` handlers.
*/
var DOMEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];
var SyntheticUIEvent = SyntheticEvent.extend({
view: null,
detail: null
});
var modifierKeyToProp = {
Alt: 'altKey',
Control: 'ctrlKey',
Meta: 'metaKey',
Shift: 'shiftKey'
};
// Older browsers (Safari <= 10, iOS Safari <= 10.2) do not support
// getModifierState. If getModifierState is not supported, we map it to a set of
// modifier keys exposed by the event. In this case, Lock-keys are not supported.
/**
* Translation from modifier key to the associated property in the event.
* @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
*/
function modifierStateGetter(keyArg) {
var syntheticEvent = this;
var nativeEvent = syntheticEvent.nativeEvent;
if (nativeEvent.getModifierState) {
return nativeEvent.getModifierState(keyArg);
}
var keyProp = modifierKeyToProp[keyArg];
return keyProp ? !!nativeEvent[keyProp] : false;
}
function getEventModifierState(nativeEvent) {
return modifierStateGetter;
}
var previousScreenX = 0;
var previousScreenY = 0;
// Use flags to signal movementX/Y has already been set
var isMovementXSet = false;
var isMovementYSet = false;
/**
* @interface MouseEvent
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var SyntheticMouseEvent = SyntheticUIEvent.extend({
screenX: null,
screenY: null,
clientX: null,
clientY: null,
pageX: null,
pageY: null,
ctrlKey: null,
shiftKey: null,
altKey: null,
metaKey: null,
getModifierState: getEventModifierState,
button: null,
buttons: null,
relatedTarget: function (event) {
return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
},
movementX: function (event) {
if ('movementX' in event) {
return event.movementX;
}
var screenX = previousScreenX;
previousScreenX = event.screenX;
if (!isMovementXSet) {
isMovementXSet = true;
return 0;
}
return event.type === 'mousemove' ? event.screenX - screenX : 0;
},
movementY: function (event) {
if ('movementY' in event) {
return event.movementY;
}
var screenY = previousScreenY;
previousScreenY = event.screenY;
if (!isMovementYSet) {
isMovementYSet = true;
return 0;
}
return event.type === 'mousemove' ? event.screenY - screenY : 0;
}
});
/**
* @interface PointerEvent
* @see http://www.w3.org/TR/pointerevents/
*/
var SyntheticPointerEvent = SyntheticMouseEvent.extend({
pointerId: null,
width: null,
height: null,
pressure: null,
tangentialPressure: null,
tiltX: null,
tiltY: null,
twist: null,
pointerType: null,
isPrimary: null
});
var eventTypes$2 = {
mouseEnter: {
registrationName: 'onMouseEnter',
dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]
},
mouseLeave: {
registrationName: 'onMouseLeave',
dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]
},
pointerEnter: {
registrationName: 'onPointerEnter',
dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]
},
pointerLeave: {
registrationName: 'onPointerLeave',
dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]
}
};
var EnterLeaveEventPlugin = {
eventTypes: eventTypes$2,
/**
* For almost every interaction we care about, there will be both a top-level
* `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
* we do not extract duplicate events. However, moving the mouse into the
* browser from outside will not fire a `mouseout` event. In this case, we use
* the `mouseover` top-level event.
*/
extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
var isOverEvent = topLevelType === TOP_MOUSE_OVER || topLevelType === TOP_POINTER_OVER;
var isOutEvent = topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_POINTER_OUT;
if (isOverEvent && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
return null;
}
if (!isOutEvent && !isOverEvent) {
// Must not be a mouse or pointer in or out - ignoring.
return null;
}
var win = void 0;
if (nativeEventTarget.window === nativeEventTarget) {
// `nativeEventTarget` is probably a window object.
win = nativeEventTarget;
} else {
// TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
var doc = nativeEventTarget.ownerDocument;
if (doc) {
win = doc.defaultView || doc.parentWindow;
} else {
win = window;
}
}
var from = void 0;
var to = void 0;
if (isOutEvent) {
from = targetInst;
var related = nativeEvent.relatedTarget || nativeEvent.toElement;
to = related ? getClosestInstanceFromNode(related) : null;
} else {
// Moving to a node from outside the window.
from = null;
to = targetInst;
}
if (from === to) {
// Nothing pertains to our managed components.
return null;
}
var eventInterface = void 0,
leaveEventType = void 0,
enterEventType = void 0,
eventTypePrefix = void 0;
if (topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_MOUSE_OVER) {
eventInterface = SyntheticMouseEvent;
leaveEventType = eventTypes$2.mouseLeave;
enterEventType = eventTypes$2.mouseEnter;
eventTypePrefix = 'mouse';
} else if (topLevelType === TOP_POINTER_OUT || topLevelType === TOP_POINTER_OVER) {
eventInterface = SyntheticPointerEvent;
leaveEventType = eventTypes$2.pointerLeave;
enterEventType = eventTypes$2.pointerEnter;
eventTypePrefix = 'pointer';
}
var fromNode = from == null ? win : getNodeFromInstance$1(from);
var toNode = to == null ? win : getNodeFromInstance$1(to);
var leave = eventInterface.getPooled(leaveEventType, from, nativeEvent, nativeEventTarget);
leave.type = eventTypePrefix + 'leave';
leave.target = fromNode;
leave.relatedTarget = toNode;
var enter = eventInterface.getPooled(enterEventType, to, nativeEvent, nativeEventTarget);
enter.type = eventTypePrefix + 'enter';
enter.target = toNode;
enter.relatedTarget = fromNode;
accumulateEnterLeaveDispatches(leave, enter, from, to);
return [leave, enter];
}
};
/*eslint-disable no-self-compare */
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
/**
* inlined Object.is polyfill to avoid requiring consumers ship their own
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
*/
function is(x, y) {
// SameValue algorithm
if (x === y) {
// Steps 1-5, 7-10
// Steps 6.b-6.e: +0 != -0
// Added the nonzero y check to make Flow happy, but it is redundant
return x !== 0 || y !== 0 || 1 / x === 1 / y;
} else {
// Step 6.a: NaN == NaN
return x !== x && y !== y;
}
}
/**
* Performs equality by iterating through keys on an object and returning false
* when any key has values which are not strictly equal between the arguments.
* Returns true when the values of all keys are strictly equal.
*/
function shallowEqual(objA, objB) {
if (is(objA, objB)) {
return true;
}
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
return false;
}
var keysA = Object.keys(objA);
var keysB = Object.keys(objB);
if (keysA.length !== keysB.length) {
return false;
}
// Test for A's keys different from B.
for (var i = 0; i < keysA.length; i++) {
if (!hasOwnProperty$1.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
return false;
}
}
return true;
}
/**
* `ReactInstanceMap` maintains a mapping from a public facing stateful
* instance (key) and the internal representation (value). This allows public
* methods to accept the user facing instance as an argument and map them back
* to internal methods.
*
* Note that this module is currently shared and assumed to be stateless.
* If this becomes an actual Map, that will break.
*/
/**
* This API should be called `delete` but we'd have to make sure to always
* transform these to strings for IE support. When this transform is fully
* supported we can rename it.
*/
function get(key) {
return key._reactInternalFiber;
}
function has(key) {
return key._reactInternalFiber !== undefined;
}
function set(key, value) {
key._reactInternalFiber = value;
}
// Don't change these two values. They're used by React Dev Tools.
var NoEffect = /* */0;
var PerformedWork = /* */1;
// You can change the rest (and add more).
var Placement = /* */2;
var Update = /* */4;
var PlacementAndUpdate = /* */6;
var Deletion = /* */8;
var ContentReset = /* */16;
var Callback = /* */32;
var DidCapture = /* */64;
var Ref = /* */128;
var Snapshot = /* */256;
var Passive = /* */512;
// Passive & Update & Callback & Ref & Snapshot
var LifecycleEffectMask = /* */932;
// Union of all host effects
var HostEffectMask = /* */1023;
var Incomplete = /* */1024;
var ShouldCapture = /* */2048;
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
var MOUNTING = 1;
var MOUNTED = 2;
var UNMOUNTED = 3;
function isFiberMountedImpl(fiber) {
var node = fiber;
if (!fiber.alternate) {
// If there is no alternate, this might be a new tree that isn't inserted
// yet. If it is, then it will have a pending insertion effect on it.
if ((node.effectTag & Placement) !== NoEffect) {
return MOUNTING;
}
while (node.return) {
node = node.return;
if ((node.effectTag & Placement) !== NoEffect) {
return MOUNTING;
}
}
} else {
while (node.return) {
node = node.return;
}
}
if (node.tag === HostRoot) {
// TODO: Check if this was a nested HostRoot when used with
// renderContainerIntoSubtree.
return MOUNTED;
}
// If we didn't hit the root, that means that we're in an disconnected tree
// that has been unmounted.
return UNMOUNTED;
}
function isFiberMounted(fiber) {
return isFiberMountedImpl(fiber) === MOUNTED;
}
function isMounted(component) {
{
var owner = ReactCurrentOwner$1.current;
if (owner !== null && owner.tag === ClassComponent) {
var ownerFiber = owner;
var instance = ownerFiber.stateNode;
!instance._warnedAboutRefsInRender ? warningWithoutStack$1(false, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber.type) || 'A component') : void 0;
instance._warnedAboutRefsInRender = true;
}
}
var fiber = get(component);
if (!fiber) {
return false;
}
return isFiberMountedImpl(fiber) === MOUNTED;
}
function assertIsMounted(fiber) {
!(isFiberMountedImpl(fiber) === MOUNTED) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0;
}
function findCurrentFiberUsingSlowPath(fiber) {
var alternate = fiber.alternate;
if (!alternate) {
// If there is no alternate, then we only need to check if it is mounted.
var state = isFiberMountedImpl(fiber);
!(state !== UNMOUNTED) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0;
if (state === MOUNTING) {
return null;
}
return fiber;
}
// If we have two possible branches, we'll walk backwards up to the root
// to see what path the root points to. On the way we may hit one of the
// special cases and we'll deal with them.
var a = fiber;
var b = alternate;
while (true) {
var parentA = a.return;
var parentB = parentA ? parentA.alternate : null;
if (!parentA || !parentB) {
// We're at the root.
break;
}
// If both copies of the parent fiber point to the same child, we can
// assume that the child is current. This happens when we bailout on low
// priority: the bailed out fiber's child reuses the current child.
if (parentA.child === parentB.child) {
var child = parentA.child;
while (child) {
if (child === a) {
// We've determined that A is the current branch.
assertIsMounted(parentA);
return fiber;
}
if (child === b) {
// We've determined that B is the current branch.
assertIsMounted(parentA);
return alternate;
}
child = child.sibling;
}
// We should never have an alternate for any mounting node. So the only
// way this could possibly happen is if this was unmounted, if at all.
invariant(false, 'Unable to find node on an unmounted component.');
}
if (a.return !== b.return) {
// The return pointer of A and the return pointer of B point to different
// fibers. We assume that return pointers never criss-cross, so A must
// belong to the child set of A.return, and B must belong to the child
// set of B.return.
a = parentA;
b = parentB;
} else {
// The return pointers point to the same fiber. We'll have to use the
// default, slow path: scan the child sets of each parent alternate to see
// which child belongs to which set.
//
// Search parent A's child set
var didFindChild = false;
var _child = parentA.child;
while (_child) {
if (_child === a) {
didFindChild = true;
a = parentA;
b = parentB;
break;
}
if (_child === b) {
didFindChild = true;
b = parentA;
a = parentB;
break;
}
_child = _child.sibling;
}
if (!didFindChild) {
// Search parent B's child set
_child = parentB.child;
while (_child) {
if (_child === a) {
didFindChild = true;
a = parentB;
b = parentA;
break;
}
if (_child === b) {
didFindChild = true;
b = parentB;
a = parentA;
break;
}
_child = _child.sibling;
}
!didFindChild ? invariant(false, 'Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.') : void 0;
}
}
!(a.alternate === b) ? invariant(false, 'Return fibers should always be each others\' alternates. This error is likely caused by a bug in React. Please file an issue.') : void 0;
}
// If the root is not a host container, we're in a disconnected tree. I.e.
// unmounted.
!(a.tag === HostRoot) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0;
if (a.stateNode.current === a) {
// We've determined that A is the current branch.
return fiber;
}
// Otherwise B has to be current branch.
return alternate;
}
function findCurrentHostFiber(parent) {
var currentParent = findCurrentFiberUsingSlowPath(parent);
if (!currentParent) {
return null;
}
// Next we'll drill down this component to find the first HostComponent/Text.
var node = currentParent;
while (tru
gitextract_79p0ubh_/
├── .gitignore
├── README.md
├── build/
│ ├── prop-types.js
│ ├── react-dom.development.js
│ ├── react.development.js
│ └── react.js
├── demo01/
│ └── index.html
├── demo02/
│ └── index.html
├── demo03/
│ └── index.html
├── demo04/
│ └── index.html
├── demo05/
│ └── index.html
├── demo06/
│ └── index.html
├── demo07/
│ └── index.html
├── demo08/
│ └── index.html
├── demo09/
│ └── index.html
├── demo10/
│ └── index.html
├── demo11/
│ └── index.html
├── demo12/
│ └── index.html
└── demo13/
├── .babelrc
├── README.md
├── app.js
├── browser.js
├── package.json
├── server.js
└── src/
├── app.js
├── browser.js
└── server.js
SYMBOL INDEX (1004 symbols across 8 files)
FILE: build/prop-types.js
function s (line 1) | function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&re...
function checkPropTypes (line 42) | function checkPropTypes(typeSpecs, values, location, componentName, getS...
function emptyFunction (line 106) | function emptyFunction() {}
function shim (line 109) | function shim(props, propName, componentName, location, propFullName, se...
function getShim (line 123) | function getShim() {
function emptyFunctionThatReturnsNull (line 187) | function emptyFunctionThatReturnsNull() {
function getIteratorFn (line 210) | function getIteratorFn(maybeIterable) {
function is (line 294) | function is(x, y) {
function PropTypeError (line 314) | function PropTypeError(message) {
function createChainableTypeChecker (line 321) | function createChainableTypeChecker(validate) {
function createPrimitiveTypeChecker (line 379) | function createPrimitiveTypeChecker(expectedType) {
function createAnyTypeChecker (line 396) | function createAnyTypeChecker() {
function createArrayOfTypeChecker (line 400) | function createArrayOfTypeChecker(typeChecker) {
function createElementTypeChecker (line 421) | function createElementTypeChecker() {
function createInstanceTypeChecker (line 433) | function createInstanceTypeChecker(expectedClass) {
function createEnumTypeChecker (line 445) | function createEnumTypeChecker(expectedValues) {
function createObjectOfTypeChecker (line 465) | function createObjectOfTypeChecker(typeChecker) {
function createUnionTypeChecker (line 488) | function createUnionTypeChecker(arrayOfTypeCheckers) {
function createNodeChecker (line 518) | function createNodeChecker() {
function createShapeTypeChecker (line 528) | function createShapeTypeChecker(shapeTypes) {
function createStrictShapeTypeChecker (line 550) | function createStrictShapeTypeChecker(shapeTypes) {
function isNode (line 580) | function isNode(propValue) {
function isSymbol (line 627) | function isSymbol(propType, propValue) {
function getPropType (line 647) | function getPropType(propValue) {
function getPreciseType (line 666) | function getPreciseType(propValue) {
function getPostfixForTypeWarning (line 683) | function getPostfixForTypeWarning(value) {
function getClassName (line 699) | function getClassName(propValue) {
function toObject (line 769) | function toObject(val) {
function shouldUseNative (line 777) | function shouldUseNative() {
FILE: build/react-dom.development.js
function invariant (line 39) | function invariant(condition, format, a, b, c, d, e, f) {
function callCallback (line 128) | function callCallback() {
function handleWindowError (line 163) | function handleWindowError(event) {
function invokeGuardedCallback (line 247) | function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
function invokeGuardedCallbackAndCatchFirstError (line 263) | function invokeGuardedCallbackAndCatchFirstError(name, func, context, a,...
function rethrowCaughtError (line 278) | function rethrowCaughtError() {
function hasCaughtError (line 287) | function hasCaughtError() {
function clearCaughtError (line 291) | function clearCaughtError() {
function recomputePluginOrdering (line 317) | function recomputePluginOrdering() {
function publishEventForPlugin (line 346) | function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
function publishRegistrationName (line 373) | function publishRegistrationName(registrationName, pluginModule, eventNa...
function injectEventPluginOrder (line 432) | function injectEventPluginOrder(injectedEventPluginOrder) {
function injectEventPluginsByName (line 449) | function injectEventPluginsByName(injectedNamesToPlugins) {
function setComponentTree (line 521) | function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceF...
function executeDispatch (line 552) | function executeDispatch(event, listener, inst) {
function executeDispatchesInOrder (line 562) | function executeDispatchesInOrder(event) {
function accumulateInto (line 617) | function accumulateInto(current, next) {
function forEachAccumulated (line 652) | function forEachAccumulated(arr, cb, scope) {
function isInteractive (line 685) | function isInteractive(tag) {
function shouldPreventMouseEvent (line 689) | function shouldPreventMouseEvent(name, type, props) {
function getListener (line 751) | function getListener(inst, registrationName) {
function extractEvents (line 781) | function extractEvents(topLevelType, targetInst, nativeEvent, nativeEven...
function runEventsInBatch (line 796) | function runEventsInBatch(events) {
function runExtractedEventsInBatch (line 816) | function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent...
function precacheFiberNode (line 844) | function precacheFiberNode(hostInst, node) {
function getClosestInstanceFromNode (line 852) | function getClosestInstanceFromNode(node) {
function getInstanceFromNode$1 (line 880) | function getInstanceFromNode$1(node) {
function getNodeFromInstance$1 (line 896) | function getNodeFromInstance$1(inst) {
function getFiberCurrentPropsFromNode$1 (line 908) | function getFiberCurrentPropsFromNode$1(node) {
function updateFiberProps (line 912) | function updateFiberProps(node, props) {
function getParent (line 916) | function getParent(inst) {
function getLowestCommonAncestor (line 935) | function getLowestCommonAncestor(instA, instB) {
function traverseTwoPhase (line 982) | function traverseTwoPhase(inst, fn, arg) {
function traverseEnterLeave (line 1004) | function traverseEnterLeave(from, to, fn, argFrom, argTo) {
function listenerAtPhase (line 1048) | function listenerAtPhase(inst, event, propagationPhase) {
function accumulateDirectionalDispatches (line 1069) | function accumulateDirectionalDispatches(inst, phase, event) {
function accumulateTwoPhaseDispatchesSingle (line 1087) | function accumulateTwoPhaseDispatchesSingle(event) {
function accumulateDispatches (line 1098) | function accumulateDispatches(inst, ignoredDirection, event) {
function accumulateDirectDispatchesSingle (line 1114) | function accumulateDirectDispatchesSingle(event) {
function accumulateTwoPhaseDispatches (line 1120) | function accumulateTwoPhaseDispatches(events) {
function accumulateEnterLeaveDispatches (line 1126) | function accumulateEnterLeaveDispatches(leave, enter, from, to) {
function accumulateDirectDispatches (line 1130) | function accumulateDirectDispatches(events) {
function unsafeCastStringToDOMTopLevelType (line 1140) | function unsafeCastStringToDOMTopLevelType(topLevelType) {
function unsafeCastDOMTopLevelTypeToString (line 1144) | function unsafeCastDOMTopLevelTypeToString(topLevelType) {
function makePrefixMap (line 1155) | function makePrefixMap(styleProp, eventName) {
function getVendorPrefixedEventName (line 1213) | function getVendorPrefixedEventName(eventName) {
function getRawEventName (line 1326) | function getRawEventName(topLevelType) {
function initialize (line 1346) | function initialize(nativeEventTarget) {
function reset (line 1352) | function reset() {
function getData (line 1358) | function getData() {
function getText (line 1388) | function getText() {
function functionThatReturnsTrue (line 1424) | function functionThatReturnsTrue() {
function functionThatReturnsFalse (line 1428) | function functionThatReturnsFalse() {
function SyntheticEvent (line 1450) | function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeE...
function Class (line 1585) | function Class() {
function getPooledWarningPropertyDefinition (line 1608) | function getPooledWarningPropertyDefinition(propName, getVal) {
function getPooledEvent (line 1635) | function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeI...
function releasePooledEvent (line 1645) | function releasePooledEvent(event) {
function addEventPoolingTo (line 1654) | function addEventPoolingTo(EventConstructor) {
function isKeypressCommand (line 1740) | function isKeypressCommand(nativeEvent) {
function getCompositionEventType (line 1752) | function getCompositionEventType(topLevelType) {
function isFallbackCompositionStart (line 1771) | function isFallbackCompositionStart(topLevelType, nativeEvent) {
function isFallbackCompositionEnd (line 1782) | function isFallbackCompositionEnd(topLevelType, nativeEvent) {
function getDataFromCustomEvent (line 1810) | function getDataFromCustomEvent(nativeEvent) {
function isUsingKoreanIME (line 1828) | function isUsingKoreanIME(nativeEvent) {
function extractCompositionEvent (line 1838) | function extractCompositionEvent(topLevelType, targetInst, nativeEvent, ...
function getNativeBeforeInputChars (line 1890) | function getNativeBeforeInputChars(topLevelType, nativeEvent) {
function getFallbackBeforeInputChars (line 1944) | function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
function extractBeforeInputEvent (line 2008) | function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, ...
function restoreStateOfTarget (line 2074) | function restoreStateOfTarget(target) {
function setRestoreImplementation (line 2087) | function setRestoreImplementation(impl) {
function enqueueStateRestore (line 2091) | function enqueueStateRestore(target) {
function needsStateRestore (line 2103) | function needsStateRestore() {
function restoreStateIfNeeded (line 2107) | function restoreStateIfNeeded() {
function batchedUpdates (line 2140) | function batchedUpdates(fn, bookkeeping) {
function interactiveUpdates (line 2166) | function interactiveUpdates(fn, a, b) {
function setBatchingImplementation (line 2172) | function setBatchingImplementation(batchedUpdatesImpl, interactiveUpdate...
function isTextInputElement (line 2199) | function isTextInputElement(elem) {
function getEventTarget (line 2230) | function getEventTarget(nativeEvent) {
function isEventSupported (line 2258) | function isEventSupported(eventNameSuffix) {
function isCheckable (line 2275) | function isCheckable(elem) {
function getTracker (line 2281) | function getTracker(node) {
function detachTracker (line 2285) | function detachTracker(node) {
function getValueFromNode (line 2289) | function getValueFromNode(node) {
function trackValueOnNode (line 2304) | function trackValueOnNode(node) {
function track (line 2353) | function track(node) {
function updateValueIfChanged (line 2362) | function updateValueIfChanged(node) {
function getIteratorFn (line 2434) | function getIteratorFn(maybeIterable) {
function refineResolvedLazyComponent (line 2449) | function refineResolvedLazyComponent(lazyComponent) {
function getWrappedName (line 2453) | function getWrappedName(outerType, innerType, wrapperName) {
function getComponentName (line 2458) | function getComponentName(type) {
function describeFiber (line 2513) | function describeFiber(fiber) {
function getStackByFiberInDevAndProd (line 2534) | function getStackByFiberInDevAndProd(workInProgress) {
function getCurrentFiberOwnerNameInDevOrNull (line 2547) | function getCurrentFiberOwnerNameInDevOrNull() {
function getCurrentFiberStackInDev (line 2560) | function getCurrentFiberStackInDev() {
function resetCurrentFiber (line 2572) | function resetCurrentFiber() {
function setCurrentFiber (line 2580) | function setCurrentFiber(fiber) {
function setCurrentPhase (line 2588) | function setCurrentPhase(lifeCyclePhase) {
function isAttributeNameSafe (line 2668) | function isAttributeNameSafe(attributeName) {
function shouldIgnoreAttribute (line 2686) | function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
function shouldRemoveAttributeWithWarning (line 2699) | function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isC...
function shouldRemoveAttribute (line 2726) | function shouldRemoveAttribute(name, value, propertyInfo, isCustomCompon...
function getPropertyInfo (line 2751) | function getPropertyInfo(name) {
function PropertyInfoRecord (line 2755) | function PropertyInfoRecord(name, type, mustUseProperty, attributeName, ...
function getValueForProperty (line 2907) | function getValueForProperty(node, name, expected, propertyInfo) {
function getValueForAttribute (line 2966) | function getValueForAttribute(node, name, expected) {
function setValueForProperty (line 2989) | function setValueForProperty(node, name, value, isCustomComponentTag) {
function toString (line 3053) | function toString(value) {
function getToStringValue (line 3057) | function getToStringValue(value) {
function checkPropTypes (line 3124) | function checkPropTypes(typeSpecs, values, location, componentName, getS...
function isControlled (line 3269) | function isControlled(props) {
function getHostProps (line 3291) | function getHostProps(element, props) {
function initWrapperState (line 3305) | function initWrapperState(element, props) {
function updateChecked (line 3329) | function updateChecked(element, props) {
function updateWrapper (line 3337) | function updateWrapper(element, props) {
function postMountWrapper (line 3413) | function postMountWrapper(element, props, isHydrating) {
function restoreControlledState (line 3521) | function restoreControlledState(element, props) {
function updateNamedCousins (line 3527) | function updateNamedCousins(rootNode, props) {
function setDefaultValue (line 3577) | function setDefaultValue(node, type, value) {
function createAndAccumulateChangeEvent (line 3599) | function createAndAccumulateChangeEvent(inst, nativeEvent, target) {
function shouldUseChangeEvent (line 3616) | function shouldUseChangeEvent(elem) {
function manualDispatchChangeEvent (line 3621) | function manualDispatchChangeEvent(nativeEvent) {
function runEventInBatch (line 3638) | function runEventInBatch(event) {
function getInstIfValueChanged (line 3642) | function getInstIfValueChanged(targetInst) {
function getTargetInstForChangeEvent (line 3649) | function getTargetInstForChangeEvent(topLevelType, targetInst) {
function startWatchingForValueChange (line 3670) | function startWatchingForValueChange(target, targetInst) {
function stopWatchingForValueChange (line 3680) | function stopWatchingForValueChange() {
function handlePropertyChange (line 3693) | function handlePropertyChange(nativeEvent) {
function handleEventsForInputEventPolyfill (line 3702) | function handleEventsForInputEventPolyfill(topLevelType, target, targetI...
function getTargetInstForInputEventPolyfill (line 3722) | function getTargetInstForInputEventPolyfill(topLevelType, targetInst) {
function shouldUseClickEvent (line 3741) | function shouldUseClickEvent(elem) {
function getTargetInstForClickEvent (line 3749) | function getTargetInstForClickEvent(topLevelType, targetInst) {
function getTargetInstForInputOrChangeEvent (line 3755) | function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {
function handleControlledInputBlur (line 3761) | function handleControlledInputBlur(node) {
function modifierStateGetter (line 3857) | function modifierStateGetter(keyArg) {
function getEventModifierState (line 3867) | function getEventModifierState(nativeEvent) {
function is (line 4064) | function is(x, y) {
function shallowEqual (line 4082) | function shallowEqual(objA, objB) {
function get (line 4125) | function get(key) {
function has (line 4129) | function has(key) {
function set (line 4133) | function set(key, value) {
function isFiberMountedImpl (line 4168) | function isFiberMountedImpl(fiber) {
function isFiberMounted (line 4197) | function isFiberMounted(fiber) {
function isMounted (line 4201) | function isMounted(component) {
function assertIsMounted (line 4219) | function assertIsMounted(fiber) {
function findCurrentFiberUsingSlowPath (line 4223) | function findCurrentFiberUsingSlowPath(fiber) {
function findCurrentHostFiber (line 4335) | function findCurrentHostFiber(parent) {
function findCurrentHostFiberWithNoPortals (line 4368) | function findCurrentHostFiberWithNoPortals(parent) {
function addEventBubbleListener (line 4401) | function addEventBubbleListener(element, eventType, listener) {
function addEventCaptureListener (line 4405) | function addEventCaptureListener(element, eventType, listener) {
function getEventCharCode (line 4448) | function getEventCharCode(nativeEvent) {
function getEventKey (line 4546) | function getEventKey(nativeEvent) {
function addEventTypeNameToConfig (line 4710) | function addEventTypeNameToConfig(_ref, isInteractive) {
function findRootContainerNode (line 4863) | function findRootContainerNode(inst) {
function getTopLevelCallbackBookKeeping (line 4878) | function getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targe...
function releaseTopLevelCallbackBookKeeping (line 4894) | function releaseTopLevelCallbackBookKeeping(instance) {
function handleTopLevel (line 4904) | function handleTopLevel(bookKeeping) {
function setEnabled (line 4934) | function setEnabled(enabled) {
function isEnabled (line 4938) | function isEnabled() {
function trapBubbledEvent (line 4951) | function trapBubbledEvent(topLevelType, element) {
function trapCapturedEvent (line 4971) | function trapCapturedEvent(topLevelType, element) {
function dispatchInteractiveEvent (line 4982) | function dispatchInteractiveEvent(topLevelType, nativeEvent) {
function dispatchEvent (line 4986) | function dispatchEvent(topLevelType, nativeEvent) {
function getListeningForDocument (line 5076) | function getListeningForDocument(mountAt) {
function listenTo (line 5107) | function listenTo(registrationName, mountAt) {
function isListeningToAllDependencies (line 5153) | function isListeningToAllDependencies(registrationName, mountAt) {
function getActiveElement (line 5165) | function getActiveElement(doc) {
function getLeafNode (line 5183) | function getLeafNode(node) {
function getSiblingNode (line 5197) | function getSiblingNode(node) {
function getNodeForCharacterOffset (line 5213) | function getNodeForCharacterOffset(root, offset) {
function getOffsets (line 5240) | function getOffsets(outerNode) {
function getModernOffsetsFromPoints (line 5284) | function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset,...
function setOffsets (line 5365) | function setOffsets(node, offsets) {
function isTextNode (line 5410) | function isTextNode(node) {
function containsNode (line 5414) | function containsNode(outerNode, innerNode) {
function isInDocument (line 5432) | function isInDocument(node) {
function getActiveElementDeep (line 5436) | function getActiveElementDeep() {
function hasSelectionCapabilities (line 5464) | function hasSelectionCapabilities(elem) {
function getSelectionInformation (line 5469) | function getSelectionInformation() {
function restoreSelection (line 5482) | function restoreSelection(priorSelectionInformation) {
function getSelection$1 (line 5522) | function getSelection$1(input) {
function setSelection (line 5545) | function setSelection(input, offsets) {
function getSelection (line 5587) | function getSelection(node) {
function getEventTargetDocument (line 5611) | function getEventTargetDocument(eventTarget) {
function constructSelectEvent (line 5622) | function constructSelectEvent(nativeEvent, nativeEventTarget) {
function flattenChildren (line 5746) | function flattenChildren(children) {
function validateProps (line 5771) | function validateProps(element, props) {
function postMountWrapper$1 (line 5803) | function postMountWrapper$1(element, props) {
function getHostProps$1 (line 5810) | function getHostProps$1(element, props) {
function getDeclarationErrorAddendum (line 5828) | function getDeclarationErrorAddendum() {
function checkSelectPropTypes (line 5841) | function checkSelectPropTypes(props) {
function updateOptions (line 5858) | function updateOptions(node, multiple, propValue, setDefaultSelected) {
function getHostProps$2 (line 5916) | function getHostProps$2(element, props) {
function initWrapperState$1 (line 5922) | function initWrapperState$1(element, props) {
function postMountWrapper$2 (line 5940) | function postMountWrapper$2(element, props) {
function postUpdateWrapper (line 5951) | function postUpdateWrapper(element, props) {
function restoreControlledState$2 (line 5970) | function restoreControlledState$2(element, props) {
function getHostProps$3 (line 5997) | function getHostProps$3(element, props) {
function initWrapperState$2 (line 6016) | function initWrapperState$2(element, props) {
function updateWrapper$1 (line 6056) | function updateWrapper$1(element, props) {
function postMountWrapper$3 (line 6077) | function postMountWrapper$3(element, props) {
function restoreControlledState$3 (line 6092) | function restoreControlledState$3(element, props) {
function getIntrinsicNamespace (line 6108) | function getIntrinsicNamespace(type) {
function getChildNamespace (line 6119) | function getChildNamespace(parentNamespace, type) {
function prefixKey (line 6308) | function prefixKey(prefix, key) {
function dangerousStyleValue (line 6335) | function dangerousStyleValue(name, value, isCustomProperty) {
function hyphenateStyleName (line 6374) | function hyphenateStyleName(name) {
function createDangerousStringForStyles (line 6480) | function createDangerousStringForStyles(styles) {
function setValueForStyles (line 6508) | function setValueForStyles(node, styles) {
function isValueEmpty (line 6532) | function isValueEmpty(value) {
function expandShorthandMap (line 6544) | function expandShorthandMap(styles) {
function validateShorthandPropertyCollisionInDev (line 6569) | function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyle...
function assertValidProps (line 6633) | function assertValidProps(tag, props) {
function isCustomComponent (line 6651) | function isCustomComponent(tagName, props) {
function validateProperty (line 7224) | function validateProperty(tagName, name) {
function warnInvalidARIAProps (line 7269) | function warnInvalidARIAProps(type, props) {
function validateProperties (line 7290) | function validateProperties(type, props) {
function validateProperties$1 (line 7299) | function validateProperties$1(type, props) {
function validateProperties$2 (line 7463) | function validateProperties$2(type, props, canUseEventSystem) {
function ensureListeningTo (line 7603) | function ensureListeningTo(rootContainerElement, registrationName) {
function getOwnerDocumentFromRootContainer (line 7609) | function getOwnerDocumentFromRootContainer(rootContainerElement) {
function noop (line 7613) | function noop() {}
function trapClickOnNonInteractiveElement (line 7615) | function trapClickOnNonInteractiveElement(node) {
function setInitialDOMProperties (line 7628) | function setInitialDOMProperties(tag, domElement, rootContainerElement, ...
function updateDOMProperties (line 7682) | function updateDOMProperties(domElement, updatePayload, wasCustomCompone...
function createElement (line 7699) | function createElement(type, props, rootContainerElement, parentNamespac...
function createTextNode (line 7760) | function createTextNode(text, rootContainerElement) {
function setInitialProperties (line 7764) | function setInitialProperties(domElement, tag, rawProps, rootContainerEl...
function diffProperties (line 7875) | function diffProperties(domElement, tag, lastRawProps, nextRawProps, roo...
function updateProperties (line 8043) | function updateProperties(domElement, updatePayload, tag, lastRawProps, ...
function getPossibleStandardName (line 8076) | function getPossibleStandardName(propName) {
function diffHydratedProperties (line 8087) | function diffHydratedProperties(domElement, tag, rawProps, parentNamespa...
function diffHydratedText (line 8339) | function diffHydratedText(textNode, text) {
function warnForUnmatchedText (line 8344) | function warnForUnmatchedText(textNode, text) {
function warnForDeletedHydratableElement (line 8350) | function warnForDeletedHydratableElement(parentNode, child) {
function warnForDeletedHydratableText (line 8360) | function warnForDeletedHydratableText(parentNode, child) {
function warnForInsertedHydratedElement (line 8370) | function warnForInsertedHydratedElement(parentNode, tag, props) {
function warnForInsertedHydratedText (line 8380) | function warnForInsertedHydratedText(parentNode, text) {
function restoreControlledState$1 (line 8397) | function restoreControlledState$1(domElement, tag, props) {
function shim (line 8721) | function shim() {
function shouldAutoFocusHostComponent (line 8746) | function shouldAutoFocusHostComponent(type, props) {
function getRootHostContext (line 8757) | function getRootHostContext(rootContainerInstance) {
function getChildHostContext (line 8787) | function getChildHostContext(parentHostContext, type, rootContainerInsta...
function getPublicInstance (line 8798) | function getPublicInstance(instance) {
function prepareForCommit (line 8802) | function prepareForCommit(containerInfo) {
function resetAfterCommit (line 8808) | function resetAfterCommit(containerInfo) {
function createInstance (line 8815) | function createInstance(type, props, rootContainerInstance, hostContext,...
function appendInitialChild (line 8834) | function appendInitialChild(parentInstance, child) {
function finalizeInitialChildren (line 8838) | function finalizeInitialChildren(domElement, type, props, rootContainerI...
function prepareUpdate (line 8843) | function prepareUpdate(domElement, type, oldProps, newProps, rootContain...
function shouldSetTextContent (line 8855) | function shouldSetTextContent(type, props) {
function shouldDeprioritizeSubtree (line 8859) | function shouldDeprioritizeSubtree(type, props) {
function createTextInstance (line 8863) | function createTextInstance(text, rootContainerInstance, hostContext, in...
function commitMount (line 8887) | function commitMount(domElement, type, newProps, internalInstanceHandle) {
function commitUpdate (line 8899) | function commitUpdate(domElement, updatePayload, type, oldProps, newProp...
function resetTextContent (line 8907) | function resetTextContent(domElement) {
function commitTextUpdate (line 8911) | function commitTextUpdate(textInstance, oldText, newText) {
function appendChild (line 8915) | function appendChild(parentInstance, child) {
function appendChildToContainer (line 8919) | function appendChildToContainer(container, child) {
function insertBefore (line 8943) | function insertBefore(parentInstance, child, beforeChild) {
function insertInContainerBefore (line 8947) | function insertInContainerBefore(container, child, beforeChild) {
function removeChild (line 8955) | function removeChild(parentInstance, child) {
function removeChildFromContainer (line 8959) | function removeChildFromContainer(container, child) {
function hideInstance (line 8967) | function hideInstance(instance) {
function hideTextInstance (line 8974) | function hideTextInstance(textInstance) {
function unhideInstance (line 8978) | function unhideInstance(instance, props) {
function unhideTextInstance (line 8985) | function unhideTextInstance(textInstance, text) {
function canHydrateInstance (line 8995) | function canHydrateInstance(instance, type, props) {
function canHydrateTextInstance (line 9003) | function canHydrateTextInstance(instance, text) {
function getNextHydratableSibling (line 9012) | function getNextHydratableSibling(instance) {
function getFirstHydratableChild (line 9021) | function getFirstHydratableChild(parentInstance) {
function hydrateInstance (line 9030) | function hydrateInstance(instance, type, props, rootContainerInstance, h...
function hydrateTextInstance (line 9043) | function hydrateTextInstance(textInstance, text, internalInstanceHandle) {
function didNotMatchHydratedContainerTextInstance (line 9048) | function didNotMatchHydratedContainerTextInstance(parentContainer, textI...
function didNotMatchHydratedTextInstance (line 9054) | function didNotMatchHydratedTextInstance(parentType, parentProps, parent...
function didNotHydrateContainerInstance (line 9060) | function didNotHydrateContainerInstance(parentContainer, instance) {
function didNotHydrateInstance (line 9070) | function didNotHydrateInstance(parentType, parentProps, parentInstance, ...
function didNotFindHydratableContainerInstance (line 9080) | function didNotFindHydratableContainerInstance(parentContainer, type, pr...
function didNotFindHydratableContainerTextInstance (line 9086) | function didNotFindHydratableContainerTextInstance(parentContainer, text) {
function didNotFindHydratableInstance (line 9092) | function didNotFindHydratableInstance(parentType, parentProps, parentIns...
function didNotFindHydratableTextInstance (line 9098) | function didNotFindHydratableTextInstance(parentType, parentProps, paren...
function recordEffect (line 9271) | function recordEffect() {
function recordScheduleUpdate (line 9277) | function recordScheduleUpdate() {
function startRequestCallbackTimer (line 9288) | function startRequestCallbackTimer() {
function stopRequestCallbackTimer (line 9297) | function stopRequestCallbackTimer(didExpire, expirationTime) {
function startWorkTimer (line 9307) | function startWorkTimer(fiber) {
function cancelWorkTimer (line 9321) | function cancelWorkTimer(fiber) {
function stopWorkTimer (line 9333) | function stopWorkTimer(fiber) {
function stopFailedWorkTimer (line 9348) | function stopFailedWorkTimer(fiber) {
function startPhaseTimer (line 9364) | function startPhaseTimer(fiber, phase) {
function stopPhaseTimer (line 9378) | function stopPhaseTimer() {
function startWorkLoopTimer (line 9392) | function startWorkLoopTimer(nextUnitOfWork) {
function stopWorkLoopTimer (line 9407) | function stopWorkLoopTimer(interruptedBy, didCompleteRoot) {
function startCommitTimer (line 9431) | function startCommitTimer() {
function stopCommitTimer (line 9443) | function stopCommitTimer() {
function startCommitSnapshotEffectsTimer (line 9464) | function startCommitSnapshotEffectsTimer() {
function stopCommitSnapshotEffectsTimer (line 9474) | function stopCommitSnapshotEffectsTimer() {
function startCommitHostEffectsTimer (line 9485) | function startCommitHostEffectsTimer() {
function stopCommitHostEffectsTimer (line 9495) | function stopCommitHostEffectsTimer() {
function startCommitLifeCyclesTimer (line 9506) | function startCommitLifeCyclesTimer() {
function stopCommitLifeCyclesTimer (line 9516) | function stopCommitLifeCyclesTimer() {
function createCursor (line 9537) | function createCursor(defaultValue) {
function pop (line 9543) | function pop(cursor, fiber) {
function push (line 9568) | function push(cursor, value, fiber) {
function checkThatStackIsEmpty (line 9580) | function checkThatStackIsEmpty() {
function resetStackAfterFatalErrorInDev (line 9588) | function resetStackAfterFatalErrorInDev() {
function getUnmaskedContext (line 9616) | function getUnmaskedContext(workInProgress, Component, didPushOwnContext...
function cacheContext (line 9627) | function cacheContext(workInProgress, unmaskedContext, maskedContext) {
function getMaskedContext (line 9633) | function getMaskedContext(workInProgress, unmaskedContext) {
function hasContextChanged (line 9667) | function hasContextChanged() {
function isContextProvider (line 9671) | function isContextProvider(type) {
function popContext (line 9676) | function popContext(fiber) {
function popTopLevelContextObject (line 9681) | function popTopLevelContextObject(fiber) {
function pushTopLevelContextObject (line 9686) | function pushTopLevelContextObject(fiber, context, didChange) {
function processChildContext (line 9693) | function processChildContext(fiber, type, parentContext) {
function pushContextProvider (line 9738) | function pushContextProvider(workInProgress) {
function invalidateContextProvider (line 9754) | function invalidateContextProvider(workInProgress, type, didChange) {
function findCurrentUnmaskedContext (line 9778) | function findCurrentUnmaskedContext(fiber) {
function catchErrors (line 9806) | function catchErrors(fn) {
function injectInternals (line 9821) | function injectInternals(internals) {
function onCommitRoot (line 9859) | function onCommitRoot(root) {
function onCommitUnmount (line 9865) | function onCommitUnmount(fiber) {
function msToExpirationTime (line 9884) | function msToExpirationTime(ms) {
function expirationTimeToMs (line 9889) | function expirationTimeToMs(expirationTime) {
function ceiling (line 9893) | function ceiling(num, precision) {
function computeExpirationBucket (line 9897) | function computeExpirationBucket(currentTime, expirationInMs, bucketSize...
function computeAsyncExpiration (line 9904) | function computeAsyncExpiration(currentTime) {
function computeInteractiveExpiration (line 9922) | function computeInteractiveExpiration(currentTime) {
function FiberNode (line 9960) | function FiberNode(tag, pendingProps, key, mode) {
function shouldConstruct (line 10052) | function shouldConstruct(Component) {
function isSimpleFunctionComponent (line 10057) | function isSimpleFunctionComponent(type) {
function resolveLazyComponentTag (line 10061) | function resolveLazyComponentTag(Component) {
function createWorkInProgress (line 10077) | function createWorkInProgress(current, pendingProps, expirationTime) {
function createHostRootFiber (line 10143) | function createHostRootFiber(isConcurrent) {
function createFiberFromTypeAndProps (line 10156) | function createFiberFromTypeAndProps(type, // React$ElementType
function createFiberFromElement (line 10227) | function createFiberFromElement(element, mode, expirationTime) {
function createFiberFromFragment (line 10243) | function createFiberFromFragment(elements, mode, expirationTime, key) {
function createFiberFromProfiler (line 10249) | function createFiberFromProfiler(pendingProps, mode, expirationTime, key) {
function createFiberFromMode (line 10265) | function createFiberFromMode(pendingProps, mode, expirationTime, key) {
function createFiberFromSuspense (line 10277) | function createFiberFromSuspense(pendingProps, mode, expirationTime, key) {
function createFiberFromText (line 10289) | function createFiberFromText(content, mode, expirationTime) {
function createFiberFromHostInstanceForDeletion (line 10295) | function createFiberFromHostInstanceForDeletion() {
function createFiberFromPortal (line 10303) | function createFiberFromPortal(portal, mode, expirationTime) {
function assignFiberPropertiesInDEV (line 10316) | function assignFiberPropertiesInDEV(target, source) {
function createFiberRoot (line 10394) | function createFiberRoot(containerInfo, isConcurrent, hydrate) {
function markPendingPriorityLevel (line 10773) | function markPendingPriorityLevel(root, expirationTime) {
function markCommittedPriorityLevels (line 10799) | function markCommittedPriorityLevels(root, earliestRemainingTime) {
function hasLowerPriorityWork (line 10874) | function hasLowerPriorityWork(root, erroredExpirationTime) {
function isPriorityLevelSuspended (line 10881) | function isPriorityLevelSuspended(root, expirationTime) {
function markSuspendedPriorityLevel (line 10887) | function markSuspendedPriorityLevel(root, suspendedTime) {
function markPingedPriorityLevel (line 10928) | function markPingedPriorityLevel(root, pingedTime) {
function clearPing (line 10941) | function clearPing(root, completedTime) {
function findEarliestOutstandingPriorityLevel (line 10948) | function findEarliestOutstandingPriorityLevel(root, renderExpirationTime) {
function didExpireAtExpirationTime (line 10962) | function didExpireAtExpirationTime(root, currentTime) {
function findNextExpirationTimeToWorkOn (line 10970) | function findNextExpirationTimeToWorkOn(completedExpirationTime, root) {
function createUpdateQueue (line 11097) | function createUpdateQueue(baseState) {
function cloneUpdateQueue (line 11112) | function cloneUpdateQueue(currentQueue) {
function createUpdate (line 11132) | function createUpdate(expirationTime) {
function appendUpdateToQueue (line 11145) | function appendUpdateToQueue(queue, update) {
function enqueueUpdate (line 11156) | function enqueueUpdate(fiber, update) {
function enqueueCapturedUpdate (line 11218) | function enqueueCapturedUpdate(workInProgress, update) {
function ensureWorkInProgressQueueIsAClone (line 11241) | function ensureWorkInProgressQueueIsAClone(workInProgress, queue) {
function getStateFromUpdate (line 11253) | function getStateFromUpdate(workInProgress, queue, update, prevState, ne...
function processUpdateQueue (line 11307) | function processUpdateQueue(workInProgress, queue, props, instance, rend...
function callCallback (line 11437) | function callCallback(callback, context) {
function resetHasForceUpdateBeforeProcessing (line 11442) | function resetHasForceUpdateBeforeProcessing() {
function checkHasForceUpdateAfterProcessing (line 11446) | function checkHasForceUpdateAfterProcessing() {
function commitUpdateQueue (line 11450) | function commitUpdateQueue(finishedWork, finishedQueue, instance, render...
function commitUpdateEffects (line 11473) | function commitUpdateEffects(effect, instance) {
function createCapturedValue (line 11484) | function createCapturedValue(value, source) {
function resetContextDependences (line 11506) | function resetContextDependences() {
function pushProvider (line 11514) | function pushProvider(providerFiber, nextValue) {
function popProvider (line 11536) | function popProvider(providerFiber) {
function calculateChangedBits (line 11549) | function calculateChangedBits(context, newValue, oldValue) {
function propagateContextChange (line 11567) | function propagateContextChange(workInProgress, context, changedBits, re...
function prepareToReadContext (line 11660) | function prepareToReadContext(workInProgress, renderExpirationTime) {
function readContext (line 11669) | function readContext(context, observedBits) {
function areHookInputsEqual (line 11711) | function areHookInputsEqual(arr1, arr2) {
function resolveCurrentlyRenderingFiber (line 11767) | function resolveCurrentlyRenderingFiber() {
function prepareToUseHooks (line 11772) | function prepareToUseHooks(current, workInProgress, nextRenderExpiration...
function finishHooks (line 11793) | function finishHooks(Component, props, children, refOrContext) {
function resetHooks (line 11851) | function resetHooks() {
function createHook (line 11878) | function createHook() {
function cloneHook (line 11890) | function cloneHook(hook) {
function createWorkInProgressHook (line 11902) | function createWorkInProgressHook() {
function createFunctionComponentUpdateQueue (line 11951) | function createFunctionComponentUpdateQueue() {
function basicStateReducer (line 11957) | function basicStateReducer(state, action) {
function useContext (line 11961) | function useContext(context, observedBits) {
function useState (line 11968) | function useState(initialState) {
function useReducer (line 11974) | function useReducer(reducer, initialState, initialAction) {
function pushEffect (line 12096) | function pushEffect(tag, create, destroy, inputs) {
function useRef (line 12122) | function useRef(initialValue) {
function useLayoutEffect (line 12139) | function useLayoutEffect(create, inputs) {
function useEffect (line 12143) | function useEffect(create, inputs) {
function useEffectImpl (line 12147) | function useEffectImpl(fiberEffectTag, hookEffectTag, create, inputs) {
function useImperativeMethods (line 12166) | function useImperativeMethods(ref, create, inputs) {
function useCallback (line 12192) | function useCallback(callback, inputs) {
function useMemo (line 12209) | function useMemo(nextCreate, inputs) {
function dispatchAction (line 12228) | function dispatchAction(fiber, queue, action) {
function requiredContext (line 12289) | function requiredContext(c) {
function getRootHostContainer (line 12294) | function getRootHostContainer() {
function pushHostContainer (line 12299) | function pushHostContainer(fiber, nextRootInstance) {
function popHostContainer (line 12319) | function popHostContainer(fiber) {
function getHostContext (line 12325) | function getHostContext() {
function pushHostContext (line 12330) | function pushHostContext(fiber) {
function popHostContext (line 12346) | function popHostContext(fiber) {
function getCommitTime (line 12360) | function getCommitTime() {
function recordCommitTime (line 12364) | function recordCommitTime() {
function startProfilerTimer (line 12371) | function startProfilerTimer(fiber) {
function stopProfilerTimerIfRunning (line 12383) | function stopProfilerTimerIfRunning(fiber) {
function stopProfilerTimerIfRunningAndRecordDelta (line 12390) | function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTim...
function resolveDefaultProps (line 12405) | function resolveDefaultProps(Component, baseProps) {
function readLazyComponentType (line 12420) | function readLazyComponentType(lazyComponent) {
function readContext$1 (line 12469) | function readContext$1(contextType) {
function applyDerivedStateFromProps (line 12539) | function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStat...
function checkShouldComponentUpdate (line 12627) | function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newP...
function checkClassInstance (line 12648) | function checkClassInstance(workInProgress, ctor, newProps) {
function adoptClassInstance (line 12717) | function adoptClassInstance(workInProgress, instance) {
function constructClassInstance (line 12727) | function constructClassInstance(workInProgress, ctor, props, renderExpir...
function callComponentWillMount (line 12810) | function callComponentWillMount(workInProgress, instance) {
function callComponentWillReceiveProps (line 12831) | function callComponentWillReceiveProps(workInProgress, instance, newProp...
function mountClassInstance (line 12855) | function mountClassInstance(workInProgress, ctor, newProps, renderExpira...
function resumeMountClassInstance (line 12923) | function resumeMountClassInstance(workInProgress, ctor, newProps, render...
function updateClassInstance (line 13018) | function updateClassInstance(current, workInProgress, ctor, newProps, re...
function coerceRef (line 13172) | function coerceRef(returnFiber, current$$1, element) {
function throwOnInvalidObjectType (line 13221) | function throwOnInvalidObjectType(returnFiber, newChild) {
function warnOnFunctionType (line 13231) | function warnOnFunctionType() {
function ChildReconciler (line 13246) | function ChildReconciler(shouldTrackSideEffects) {
function cloneChildFibers (line 14045) | function cloneChildFibers(current$$1, workInProgress) {
function enterHydrationState (line 14071) | function enterHydrationState(fiber) {
function deleteHydratableInstance (line 14083) | function deleteHydratableInstance(returnFiber, instance) {
function insertNonHydratedInstance (line 14113) | function insertNonHydratedInstance(returnFiber, fiber) {
function tryHydrate (line 14157) | function tryHydrate(fiber, nextInstance) {
function tryToClaimNextHydratableInstance (line 14185) | function tryToClaimNextHydratableInstance(fiber) {
function prepareToHydrateHostInstance (line 14220) | function prepareToHydrateHostInstance(fiber, rootContainerInstance, host...
function prepareToHydrateHostTextInstance (line 14237) | function prepareToHydrateHostTextInstance(fiber) {
function popToNextHostParent (line 14273) | function popToNextHostParent(fiber) {
function popHydrationState (line 14281) | function popHydrationState(fiber) {
function resetHydrationState (line 14319) | function resetHydrationState() {
function reconcileChildren (line 14345) | function reconcileChildren(current$$1, workInProgress, nextChildren, ren...
function forceUnmountCurrentAndReconcile (line 14363) | function forceUnmountCurrentAndReconcile(current$$1, workInProgress, nex...
function updateForwardRef (line 14380) | function updateForwardRef(current$$1, workInProgress, Component, nextPro...
function updateMemoComponent (line 14414) | function updateMemoComponent(current$$1, workInProgress, Component, next...
function updateSimpleMemoComponent (line 14476) | function updateSimpleMemoComponent(current$$1, workInProgress, Component...
function updateFragment (line 14505) | function updateFragment(current$$1, workInProgress, renderExpirationTime) {
function updateMode (line 14511) | function updateMode(current$$1, workInProgress, renderExpirationTime) {
function updateProfiler (line 14517) | function updateProfiler(current$$1, workInProgress, renderExpirationTime) {
function markRef (line 14527) | function markRef(current$$1, workInProgress) {
function updateFunctionComponent (line 14535) | function updateFunctionComponent(current$$1, workInProgress, Component, ...
function updateClassComponent (line 14568) | function updateClassComponent(current$$1, workInProgress, Component, nex...
function finishClassComponent (line 14627) | function finishClassComponent(current$$1, workInProgress, Component, sho...
function pushHostRootContext (line 14693) | function pushHostRootContext(workInProgress) {
function updateHostRoot (line 14704) | function updateHostRoot(current$$1, workInProgress, renderExpirationTime) {
function updateHostComponent (line 14748) | function updateHostComponent(current$$1, workInProgress, renderExpiratio...
function updateHostText (line 14787) | function updateHostText(current$$1, workInProgress) {
function mountLazyComponent (line 14796) | function mountLazyComponent(_current, workInProgress, elementType, updat...
function mountIncompleteClassComponent (line 14867) | function mountIncompleteClassComponent(_current, workInProgress, Compone...
function mountIndeterminateComponent (line 14902) | function mountIndeterminateComponent(_current, workInProgress, Component...
function validateFunctionComponentInDev (line 14983) | function validateFunctionComponentInDev(workInProgress, Component) {
function updateSuspenseComponent (line 15024) | function updateSuspenseComponent(current$$1, workInProgress, renderExpir...
function updatePortalComponent (line 15230) | function updatePortalComponent(current$$1, workInProgress, renderExpirat...
function updateContextProvider (line 15246) | function updateContextProvider(current$$1, workInProgress, renderExpirat...
function updateContextConsumer (line 15287) | function updateContextConsumer(current$$1, workInProgress, renderExpirat...
function bailoutOnAlreadyFinishedWork (line 15334) | function bailoutOnAlreadyFinishedWork(current$$1, workInProgress, render...
function beginWork (line 15362) | function beginWork(current$$1, workInProgress, renderExpirationTime) {
function markUpdate (line 15525) | function markUpdate(workInProgress) {
function markRef$1 (line 15531) | function markRef$1(workInProgress) {
function completeWork (line 15865) | function completeWork(current, workInProgress, renderExpirationTime) {
function shouldCaptureSuspense (line 16066) | function shouldCaptureSuspense(workInProgress) {
function showErrorDialog (line 16080) | function showErrorDialog(capturedError) {
function logCapturedError (line 16084) | function logCapturedError(capturedError) {
function logError (line 16151) | function logError(boundary, errorInfo) {
function safelyCallComponentWillUnmount (line 16197) | function safelyCallComponentWillUnmount(current$$1, instance) {
function safelyDetachRef (line 16207) | function safelyDetachRef(current$$1) {
function safelyCallDestroy (line 16224) | function safelyCallDestroy(current$$1, destroy) {
function commitBeforeMutationLifeCycles (line 16234) | function commitBeforeMutationLifeCycles(current$$1, finishedWork) {
function commitHookEffectList (line 16288) | function commitHookEffectList(unmountTag, mountTag, finishedWork) {
function commitPassiveHookEffects (line 16325) | function commitPassiveHookEffects(finishedWork) {
function commitLifeCycles (line 16330) | function commitLifeCycles(finishedRoot, current$$1, finishedWork, commit...
function hideOrUnhideAllChildren (line 16457) | function hideOrUnhideAllChildren(finishedWork, isHidden) {
function commitAttachRef (line 16502) | function commitAttachRef(finishedWork) {
function commitDetachRef (line 16528) | function commitDetachRef(current$$1) {
function commitUnmount (line 16542) | function commitUnmount(current$$1) {
function commitNestedUnmounts (line 16597) | function commitNestedUnmounts(root) {
function detachFiber (line 16629) | function detachFiber(current$$1) {
function emptyPortalContainer (line 16648) | function emptyPortalContainer(current$$1) {
function commitContainer (line 16660) | function commitContainer(finishedWork) {
function getHostParentFiber (line 16695) | function getHostParentFiber(fiber) {
function isHostParent (line 16706) | function isHostParent(fiber) {
function getHostSibling (line 16710) | function getHostSibling(fiber) {
function commitPlacement (line 16751) | function commitPlacement(finishedWork) {
function unmountHostComponents (line 16828) | function unmountHostComponents(current$$1) {
function commitDeletion (line 16913) | function commitDeletion(current$$1) {
function commitWork (line 16925) | function commitWork(current$$1, finishedWork) {
function commitResetTextContent (line 17058) | function commitResetTextContent(current$$1) {
function createRootErrorUpdate (line 17067) | function createRootErrorUpdate(fiber, errorInfo, expirationTime) {
function createClassErrorUpdate (line 17082) | function createClassErrorUpdate(fiber, errorInfo, expirationTime) {
function throwException (line 17123) | function throwException(root, returnFiber, sourceFiber, value, renderExp...
function unwindWork (line 17332) | function unwindWork(workInProgress, renderExpirationTime) {
function unwindInterruptedWork (line 17382) | function unwindInterruptedWork(interruptedWork) {
function resetStack (line 17592) | function resetStack() {
function commitAllHostEffects (line 17613) | function commitAllHostEffects() {
function commitBeforeMutationLifecycles (line 17683) | function commitBeforeMutationLifecycles() {
function commitAllLifeCycles (line 17704) | function commitAllLifeCycles(finishedRoot, committedExpirationTime) {
function commitPassiveEffects (line 17735) | function commitPassiveEffects(root, firstEffect) {
function isAlreadyFailedLegacyErrorBoundary (line 17772) | function isAlreadyFailedLegacyErrorBoundary(instance) {
function markLegacyErrorBoundaryAsFailed (line 17776) | function markLegacyErrorBoundaryAsFailed(instance) {
function flushPassiveEffects (line 17784) | function flushPassiveEffects() {
function commitRoot (line 17793) | function commitRoot(root, finishedWork) {
function resetChildExpirationTime (line 18017) | function resetChildExpirationTime(workInProgress, renderTime) {
function completeUnitOfWork (line 18078) | function completeUnitOfWork(workInProgress) {
function performUnitOfWork (line 18254) | function performUnitOfWork(workInProgress) {
function workLoop (line 18313) | function workLoop(isYieldy) {
function renderRoot (line 18327) | function renderRoot(root, isYieldy) {
function captureCommitPhaseError (line 18580) | function captureCommitPhaseError(sourceFiber, value) {
function computeThreadID (line 18619) | function computeThreadID(expirationTime, interactionThreadID) {
function computeUniqueAsyncExpiration (line 18625) | function computeUniqueAsyncExpiration() {
function computeExpirationForFiber (line 18638) | function computeExpirationForFiber(currentTime, fiber) {
function renderDidSuspend (line 18685) | function renderDidSuspend(root, absoluteTimeoutMs, suspendedTime) {
function renderDidError (line 18692) | function renderDidError() {
function pingSuspendedRoot (line 18696) | function pingSuspendedRoot(root, thenable, pingTime) {
function retryTimedOutBoundary (line 18724) | function retryTimedOutBoundary(boundaryFiber, thenable) {
function scheduleWorkToRoot (line 18747) | function scheduleWorkToRoot(fiber, expirationTime) {
function scheduleWork (line 18824) | function scheduleWork(fiber, expirationTime) {
function syncUpdates (line 18865) | function syncUpdates(fn, a, b, c, d) {
function recomputeCurrentRendererTime (line 18906) | function recomputeCurrentRendererTime() {
function scheduleCallbackWithExpirationTime (line 18911) | function scheduleCallbackWithExpirationTime(root, expirationTime) {
function onFatal (line 18940) | function onFatal(root) {
function onComplete (line 18944) | function onComplete(root, finishedWork, expirationTime) {
function onSuspend (line 18949) | function onSuspend(root, finishedWork, suspendedExpirationTime, rootExpi...
function onYield (line 18961) | function onYield(root) {
function onTimeout (line 18965) | function onTimeout(root, finishedWork, suspendedExpirationTime) {
function onCommit (line 18977) | function onCommit(root, expirationTime) {
function requestCurrentTime (line 18982) | function requestCurrentTime() {
function requestWork (line 19025) | function requestWork(root, expirationTime) {
function addRootToSchedule (line 19053) | function addRootToSchedule(root, expirationTime) {
function findHighestPriorityRoot (line 19077) | function findHighestPriorityRoot() {
function shouldYieldToRenderer (line 19142) | function shouldYieldToRenderer() {
function performAsyncWork (line 19153) | function performAsyncWork() {
function performSyncWork (line 19177) | function performSyncWork() {
function performWork (line 19181) | function performWork(minExpirationTime, isYieldy) {
function flushRoot (line 19226) | function flushRoot(root, expirationTime) {
function finishRendering (line 19238) | function finishRendering() {
function performWorkOnRoot (line 19266) | function performWorkOnRoot(root, expirationTime, isYieldy) {
function completeRoot (line 19335) | function completeRoot(root, finishedWork, expirationTime) {
function onUncaughtError (line 19370) | function onUncaughtError(error) {
function batchedUpdates$1 (line 19383) | function batchedUpdates$1(fn, a) {
function unbatchedUpdates (line 19398) | function unbatchedUpdates(fn, a) {
function flushSync (line 19412) | function flushSync(fn, a) {
function interactiveUpdates$1 (line 19424) | function interactiveUpdates$1(fn, a, b) {
function flushInteractiveUpdates$1 (line 19452) | function flushInteractiveUpdates$1() {
function flushControlled (line 19460) | function flushControlled(fn) {
function getContextForSubtree (line 19485) | function getContextForSubtree(parentComponent) {
function scheduleRootUpdate (line 19503) | function scheduleRootUpdate(current$$1, element, expirationTime, callbac...
function updateContainerAtExpirationTime (line 19529) | function updateContainerAtExpirationTime(element, container, parentCompo...
function findHostInstance (line 19555) | function findHostInstance(component) {
function findHostInstanceWithWarning (line 19571) | function findHostInstanceWithWarning(component, methodName) {
function createContainer (line 19601) | function createContainer(containerInfo, isConcurrent, hydrate) {
function updateContainer (line 19605) | function updateContainer(element, container, parentComponent, callback) {
function getPublicRootInstance (line 19612) | function getPublicRootInstance(container) {
function findHostInstanceWithNoPortals (line 19625) | function findHostInstanceWithNoPortals(fiber) {
function injectIntoDevTools (line 19662) | function injectIntoDevTools(devToolsConfig) {
function createPortal$1 (line 19687) | function createPortal$1(children, containerInfo,
function ReactBatch (line 19747) | function ReactBatch(root) {
function ReactWork (line 19852) | function ReactWork() {
function ReactRoot (line 19887) | function ReactRoot(container, isConcurrent, hydrate) {
function isValidContainer (line 19963) | function isValidContainer(node) {
function getReactRootElementInContainer (line 19967) | function getReactRootElementInContainer(container) {
function shouldHydrateDueToLegacyHeuristic (line 19979) | function shouldHydrateDueToLegacyHeuristic(container) {
function legacyCreateRootFromDOMContainer (line 19988) | function legacyCreateRootFromDOMContainer(container, forceHydrate) {
function legacyRenderSubtreeIntoContainer (line 20015) | function legacyRenderSubtreeIntoContainer(parentComponent, children, con...
function createPortal$$1 (line 20062) | function createPortal$$1(children, container) {
function createRoot (line 20166) | function createRoot(container, options) {
FILE: build/react.development.js
function getIteratorFn (line 43) | function getIteratorFn(maybeIterable) {
function toObject (line 106) | function toObject(val) {
function shouldUseNative (line 114) | function shouldUseNative() {
function invariant (line 206) | function invariant(condition, format, a, b, c, d, e, f) {
function warnNoop (line 335) | function warnNoop(publicInstance, callerName) {
function Component (line 424) | function Component(props, context, updater) {
function ComponentDummy (line 509) | function ComponentDummy() {}
function PureComponent (line 515) | function PureComponent(props, context, updater) {
function createRef (line 530) | function createRef() {
function ensureHostCallbackIsScheduled (line 581) | function ensureHostCallbackIsScheduled() {
function flushFirstCallback (line 597) | function flushFirstCallback() {
function flushImmediateWork (line 680) | function flushImmediateWork() {
function flushWork (line 703) | function flushWork(didTimeout) {
function unstable_runWithPriority (line 755) | function unstable_runWithPriority(priorityLevel, eventHandler) {
function unstable_wrapCallback (line 783) | function unstable_wrapCallback(callback) {
function unstable_scheduleCallback (line 802) | function unstable_scheduleCallback(callback, deprecated_options) {
function unstable_pauseExecution (line 875) | function unstable_pauseExecution() {
function unstable_continueExecution (line 879) | function unstable_continueExecution() {
function unstable_getFirstCallbackNode (line 886) | function unstable_getFirstCallbackNode() {
function unstable_cancelCallback (line 890) | function unstable_cancelCallback(callbackNode) {
function unstable_getCurrentPriorityLevel (line 913) | function unstable_getCurrentPriorityLevel() {
function unstable_shouldYield (line 917) | function unstable_shouldYield() {
function unstable_clear (line 1196) | function unstable_clear(callback) {
function unstable_getCurrent (line 1211) | function unstable_getCurrent() {
function unstable_getThreadID (line 1219) | function unstable_getThreadID() {
function unstable_trace (line 1223) | function unstable_trace(name, timestamp, callback) {
function unstable_wrap (line 1284) | function unstable_wrap(callback) {
function unstable_subscribe (line 1382) | function unstable_subscribe(subscriber) {
function unstable_unsubscribe (line 1399) | function unstable_unsubscribe(subscriber) {
function onInteractionTraced (line 1409) | function onInteractionTraced(interaction) {
function onInteractionScheduledWorkCompleted (line 1429) | function onInteractionScheduledWorkCompleted(interaction) {
function onWorkScheduled (line 1449) | function onWorkScheduled(interactions, threadID) {
function onWorkStarted (line 1469) | function onWorkStarted(interactions, threadID) {
function onWorkStopped (line 1489) | function onWorkStopped(interactions, threadID) {
function onWorkCanceled (line 1509) | function onWorkCanceled(interactions, threadID) {
function refineResolvedLazyComponent (line 1575) | function refineResolvedLazyComponent(lazyComponent) {
function getWrappedName (line 1579) | function getWrappedName(outerType, innerType, wrapperName) {
function getComponentName (line 1584) | function getComponentName(type) {
function setCurrentlyValidatingElement (line 1641) | function setCurrentlyValidatingElement(element) {
function hasValidRef (line 1760) | function hasValidRef(config) {
function hasValidKey (line 1772) | function hasValidKey(config) {
function defineKeyPropWarningGetter (line 1784) | function defineKeyPropWarningGetter(props, displayName) {
function defineRefPropWarningGetter (line 1798) | function defineRefPropWarningGetter(props, displayName) {
function createElement (line 1892) | function createElement(type, config, children) {
function cloneAndReplaceKey (line 1968) | function cloneAndReplaceKey(oldElement, newKey) {
function cloneElement (line 1978) | function cloneElement(element, config, children) {
function isValidElement (line 2049) | function isValidElement(object) {
function escape (line 2062) | function escape(key) {
function escapeUserProvidedKey (line 2083) | function escapeUserProvidedKey(text) {
function getPooledTraverseContext (line 2089) | function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, map...
function releaseTraverseContext (line 2109) | function releaseTraverseContext(traverseContext) {
function traverseAllChildrenImpl (line 2128) | function traverseAllChildrenImpl(children, nameSoFar, callback, traverse...
function traverseAllChildren (line 2222) | function traverseAllChildren(children, callback, traverseContext) {
function getComponentKey (line 2237) | function getComponentKey(component, index) {
function forEachSingleChild (line 2248) | function forEachSingleChild(bookKeeping, child, name) {
function forEachChildren (line 2267) | function forEachChildren(children, forEachFunc, forEachContext) {
function mapSingleChildIntoContext (line 2276) | function mapSingleChildIntoContext(bookKeeping, child, childKey) {
function mapIntoWithKeyPrefixInternal (line 2299) | function mapIntoWithKeyPrefixInternal(children, array, prefix, func, con...
function mapChildren (line 2322) | function mapChildren(children, func, context) {
function countChildren (line 2340) | function countChildren(children) {
function toArray (line 2352) | function toArray(children) {
function onlyChild (line 2374) | function onlyChild(children) {
function createContext (line 2379) | function createContext(defaultValue, calculateChangedBits) {
function lazy (line 2483) | function lazy(ctor) {
function forwardRef (line 2531) | function forwardRef(render) {
function isValidElementType (line 2554) | function isValidElementType(type) {
function memo (line 2560) | function memo(type, compare) {
function resolveDispatcher (line 2573) | function resolveDispatcher() {
function useContext (line 2579) | function useContext(Context, observedBits) {
function useState (line 2597) | function useState(initialState) {
function useReducer (line 2602) | function useReducer(reducer, initialState, initialAction) {
function useRef (line 2607) | function useRef(initialValue) {
function useEffect (line 2612) | function useEffect(create, inputs) {
function useLayoutEffect (line 2617) | function useLayoutEffect(create, inputs) {
function useCallback (line 2622) | function useCallback(callback, inputs) {
function useMemo (line 2627) | function useMemo(create, inputs) {
function useImperativeMethods (line 2632) | function useImperativeMethods(ref, create, inputs) {
function checkPropTypes (line 2690) | function checkPropTypes(typeSpecs, values, location, componentName, getS...
function getDeclarationErrorAddendum (line 2755) | function getDeclarationErrorAddendum() {
function getSourceInfoErrorAddendum (line 2765) | function getSourceInfoErrorAddendum(elementProps) {
function getCurrentComponentErrorInfo (line 2782) | function getCurrentComponentErrorInfo(parentType) {
function validateExplicitKey (line 2805) | function validateExplicitKey(element, parentType) {
function validateChildKeys (line 2842) | function validateChildKeys(node, parentType) {
function validatePropTypes (line 2882) | function validatePropTypes(element) {
function validateFragmentProps (line 2916) | function validateFragmentProps(fragment) {
function createElementWithValidation (line 2935) | function createElementWithValidation(type, props, children) {
function createFactoryWithValidation (line 2996) | function createFactoryWithValidation(type) {
function cloneElementWithValidation (line 3016) | function cloneElementWithValidation(element, props, children) {
FILE: build/react.js
function s (line 4) | function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&re...
function isPresto (line 76) | function isPresto() {
function isKeypressCommand (line 126) | function isKeypressCommand(nativeEvent) {
function getCompositionEventType (line 138) | function getCompositionEventType(topLevelType) {
function isFallbackCompositionStart (line 157) | function isFallbackCompositionStart(topLevelType, nativeEvent) {
function isFallbackCompositionEnd (line 168) | function isFallbackCompositionEnd(topLevelType, nativeEvent) {
function getDataFromCustomEvent (line 196) | function getDataFromCustomEvent(nativeEvent) {
function extractCompositionEvent (line 210) | function extractCompositionEvent(topLevelType, targetInst, nativeEvent, ...
function getNativeBeforeInputChars (line 262) | function getNativeBeforeInputChars(topLevelType, nativeEvent) {
function getFallbackBeforeInputChars (line 316) | function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
function extractBeforeInputEvent (line 368) | function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, ...
function prefixKey (line 481) | function prefixKey(prefix, key) {
function CallbackQueue (line 804) | function CallbackQueue() {
function shouldUseChangeEvent (line 929) | function shouldUseChangeEvent(elem) {
function manualDispatchChangeEvent (line 940) | function manualDispatchChangeEvent(nativeEvent) {
function runEventInBatch (line 958) | function runEventInBatch(event) {
function startWatchingForChangeEventIE8 (line 963) | function startWatchingForChangeEventIE8(target, targetInst) {
function stopWatchingForChangeEventIE8 (line 969) | function stopWatchingForChangeEventIE8() {
function getTargetInstForChangeEvent (line 978) | function getTargetInstForChangeEvent(topLevelType, targetInst) {
function handleEventsForChangeEventIE8 (line 983) | function handleEventsForChangeEventIE8(topLevelType, target, targetInst) {
function startWatchingForValueChange (line 1026) | function startWatchingForValueChange(target, targetInst) {
function stopWatchingForValueChange (line 1046) | function stopWatchingForValueChange() {
function handlePropertyChange (line 1070) | function handlePropertyChange(nativeEvent) {
function getTargetInstForInputEvent (line 1086) | function getTargetInstForInputEvent(topLevelType, targetInst) {
function handleEventsForInputEventIE (line 1094) | function handleEventsForInputEventIE(topLevelType, target, targetInst) {
function getTargetInstForInputEventIE (line 1117) | function getTargetInstForInputEventIE(topLevelType, targetInst) {
function shouldUseClickEvent (line 1139) | function shouldUseClickEvent(elem) {
function getTargetInstForClickEvent (line 1146) | function getTargetInstForClickEvent(topLevelType, targetInst) {
function getNodeAfter (line 1228) | function getNodeAfter(parentNode, node) {
function insertLazyTreeChildAt (line 1252) | function insertLazyTreeChildAt(parentNode, childTree, referenceNode) {
function moveChild (line 1256) | function moveChild(parentNode, childNode, referenceNode) {
function removeChild (line 1264) | function removeChild(parentNode, childNode) {
function moveDelimitedText (line 1274) | function moveDelimitedText(parentNode, openingComment, closingComment, r...
function removeDelimitedText (line 1286) | function removeDelimitedText(parentNode, startNode, closingComment) {
function replaceDelimitedText (line 1298) | function replaceDelimitedText(openingComment, closingComment, stringText) {
function insertTreeChildren (line 1395) | function insertTreeChildren(tree) {
function replaceChildWithTree (line 1426) | function replaceChildWithTree(oldNode, newTree) {
function queueChild (line 1431) | function queueChild(parentTree, childTree) {
function queueHTML (line 1439) | function queueHTML(tree, html) {
function queueText (line 1447) | function queueText(tree, text) {
function DOMLazyTree (line 1455) | function DOMLazyTree(node) {
function checkMask (line 1508) | function checkMask(value, bitmask) {
function isAttributeNameSafe (line 1731) | function isAttributeNameSafe(attributeName) {
function shouldIgnoreValue (line 1747) | function shouldIgnoreValue(propertyInfo, value) {
function getNodeName (line 1956) | function getNodeName(markup) {
function recomputePluginOrdering (line 2564) | function recomputePluginOrdering() {
function publishEventForPlugin (line 2593) | function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
function publishRegistrationName (line 2621) | function publishRegistrationName(registrationName, PluginModule, eventNa...
function isEndish (line 2822) | function isEndish(topLevelType) {
function isMoveish (line 2826) | function isMoveish(topLevelType) {
function isStartish (line 2829) | function isStartish(topLevelType) {
function executeDispatch (line 2856) | function executeDispatch(event, simulated, listener, inst) {
function executeDispatchesInOrder (line 2870) | function executeDispatchesInOrder(event, simulated) {
function executeDispatchesInOrderStopAtTrueImpl (line 2898) | function executeDispatchesInOrderStopAtTrueImpl(event) {
function executeDispatchesInOrderStopAtTrue (line 2925) | function executeDispatchesInOrderStopAtTrue(event) {
function executeDirectDispatch (line 2941) | function executeDirectDispatch(event) {
function hasDispatches (line 2960) | function hasDispatches(event) {
function listenerAtPhase (line 3032) | function listenerAtPhase(inst, event, propagationPhase) {
function accumulateDirectionalDispatches (line 3043) | function accumulateDirectionalDispatches(inst, upwards, event) {
function accumulateTwoPhaseDispatchesSingle (line 3062) | function accumulateTwoPhaseDispatchesSingle(event) {
function accumulateTwoPhaseDispatchesSingleSkipTarget (line 3071) | function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
function accumulateDispatches (line 3084) | function accumulateDispatches(inst, ignoredDirection, event) {
function accumulateDirectDispatchesSingle (line 3100) | function accumulateDirectDispatchesSingle(event) {
function accumulateTwoPhaseDispatches (line 3106) | function accumulateTwoPhaseDispatches(events) {
function accumulateTwoPhaseDispatchesSkipTarget (line 3110) | function accumulateTwoPhaseDispatchesSkipTarget(events) {
function accumulateEnterLeaveDispatches (line 3114) | function accumulateEnterLeaveDispatches(leave, enter, from, to) {
function accumulateDirectDispatches (line 3118) | function accumulateDirectDispatches(events) {
function FallbackCompositionState (line 3172) | function FallbackCompositionState(root) {
function _assertSingleLink (line 3477) | function _assertSingleLink(inputProps) {
function _assertValueLink (line 3480) | function _assertValueLink(inputProps) {
function _assertCheckedLink (line 3485) | function _assertCheckedLink(inputProps) {
function getDeclarationErrorAddendum (line 3507) | function getDeclarationErrorAddendum(owner) {
function getListeningForDocument (line 3948) | function getListeningForDocument(mountAt) {
function instantiateChild (line 4128) | function instantiateChild(childInstances, child, name) {
function escapeUserProvidedKey (line 4256) | function escapeUserProvidedKey(text) {
function ForEachBookKeeping (line 4268) | function ForEachBookKeeping(forEachFunction, forEachContext) {
function forEachSingleChild (line 4280) | function forEachSingleChild(bookKeeping, child, name) {
function forEachChildren (line 4297) | function forEachChildren(children, forEachFunc, forEachContext) {
function MapBookKeeping (line 4315) | function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
function mapSingleChildIntoContext (line 4331) | function mapSingleChildIntoContext(bookKeeping, child, childKey) {
function mapIntoWithKeyPrefixInternal (line 4352) | function mapIntoWithKeyPrefixInternal(children, array, prefix, func, con...
function mapChildren (line 4373) | function mapChildren(children, func, context) {
function forEachSingleChildDummy (line 4382) | function forEachSingleChildDummy(traverseContext, child, name) {
function countChildren (line 4393) | function countChildren(children, context) {
function toArray (line 4401) | function toArray(children) {
function validateTypeDef (line 4773) | function validateTypeDef(Constructor, typeDef, location) {
function validateMethodOverride (line 4783) | function validateMethodOverride(isAlreadyDefined, name) {
function mixSpecIntoComponent (line 4801) | function mixSpecIntoComponent(Constructor, spec) {
function mixStaticSpecIntoComponent (line 4876) | function mixStaticSpecIntoComponent(Constructor, statics) {
function mergeIntoWithNoDuplicateKeys (line 4902) | function mergeIntoWithNoDuplicateKeys(one, two) {
function createMergedResultFunction (line 4922) | function createMergedResultFunction(one, two) {
function createChainedFunction (line 4946) | function createChainedFunction(one, two) {
function bindAutoBindMethod (line 4960) | function bindAutoBindMethod(component, method) {
function bindAutoBindMethods (line 4997) | function bindAutoBindMethods(component) {
function ReactComponent (line 5165) | function ReactComponent(props, context, updater) {
function getDeclarationErrorAddendum (line 5393) | function getDeclarationErrorAddendum(component) {
function StatelessComponent (line 5404) | function StatelessComponent(Component) {}
function warnIfInvalidElement (line 5412) | function warnIfInvalidElement(Component, element) {
function getDeclarationErrorAddendum (line 6398) | function getDeclarationErrorAddendum(internalInstance) {
function friendlyStringify (line 6411) | function friendlyStringify(obj) {
function checkAndWarnForMutatedStyle (line 6437) | function checkAndWarnForMutatedStyle(style1, style2, component) {
function assertValidProps (line 6467) | function assertValidProps(component, props) {
function enqueuePutListener (line 6487) | function enqueuePutListener(inst, registrationName, listener, transactio...
function putListener (line 6507) | function putListener() {
function optionPostMount (line 6512) | function optionPostMount() {
function trapBubbledEventsLocal (line 6545) | function trapBubbledEventsLocal() {
function postUpdateSelectWrapper (line 6584) | function postUpdateSelectWrapper() {
function validateDangerousTag (line 6631) | function validateDangerousTag(tag) {
function isCustomComponent (line 6638) | function isCustomComponent(tagName, props) {
function ReactDOMComponent (line 6658) | function ReactDOMComponent(element) {
function getRenderedNativeOrTextFromComponent (line 7290) | function getRenderedNativeOrTextFromComponent(component) {
function precacheNode (line 7302) | function precacheNode(inst, node) {
function uncacheNode (line 7308) | function uncacheNode(inst) {
function precacheChildNodes (line 7330) | function precacheChildNodes(inst, node) {
function getClosestInstanceFromNode (line 7363) | function getClosestInstanceFromNode(node) {
function getInstanceFromNode (line 7397) | function getInstanceFromNode(node) {
function getNodeFromInstance (line 7410) | function getNodeFromInstance(inst) {
function ReactDOMContainerInfo (line 7464) | function ReactDOMContainerInfo(topLevelWrapper, node) {
function emitEvent (line 7500) | function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
function createDOMFactory (line 7627) | function createDOMFactory(tag) {
function forceUpdateIfMounted (line 7870) | function forceUpdateIfMounted() {
function warnIfValueIsNull (line 7877) | function warnIfValueIsNull(props) {
function _handleChange (line 7993) | function _handleChange(event) {
function updateOptionsIfPendingUpdateAndMounted (line 8187) | function updateOptionsIfPendingUpdateAndMounted() {
function getDeclarationErrorAddendum (line 8200) | function getDeclarationErrorAddendum(owner) {
function warnIfValueIsNull (line 8210) | function warnIfValueIsNull(props) {
function checkSelectPropTypes (line 8224) | function checkSelectPropTypes(inst, props) {
function updateOptions (line 8252) | function updateOptions(inst, multiple, propValue) {
function _handleChange (line 8362) | function _handleChange(event) {
function isCollapsed (line 8398) | function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
function getIEOffsets (line 8416) | function getIEOffsets(node) {
function getModernOffsets (line 8439) | function getModernOffsets(node) {
function setIEOffsets (line 8501) | function setIEOffsets(node, offsets) {
function setModernOffsets (line 8535) | function setModernOffsets(node, offsets) {
function forceUpdateIfMounted (line 8812) | function forceUpdateIfMounted() {
function warnIfValueIsNull (line 8819) | function warnIfValueIsNull(props) {
function _handleChange (line 8918) | function _handleChange(event) {
function getLowestCommonAncestor (line 8946) | function getLowestCommonAncestor(instA, instB) {
function isAncestor (line 8986) | function isAncestor(instA, instB) {
function getParentInstance (line 9002) | function getParentInstance(inst) {
function traverseTwoPhase (line 9011) | function traverseTwoPhase(inst, fn, arg) {
function traverseEnterLeave (line 9033) | function traverseEnterLeave(from, to, fn, argFrom, argTo) {
function emitEvent (line 9146) | function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
function ReactDefaultBatchingStrategyTransaction (line 9234) | function ReactDefaultBatchingStrategyTransaction() {
function inject (line 9304) | function inject() {
function roundFloat (line 9385) | function roundFloat(val) {
function addValue (line 9389) | function addValue(obj, key, val) {
function getIDOfComposite (line 9396) | function getIDOfComposite(inst) {
function getID (line 9409) | function getID(inst) {
function stripComplexValues (line 9417) | function stripComplexValues(key, value) {
function wrapLegacyMeasurements (line 9432) | function wrapLegacyMeasurements(measurements) {
function unwrapLegacyMeasurements (line 9435) | function unwrapLegacyMeasurements(measurements) {
function getTotalTime (line 9713) | function getTotalTime(measurements) {
function getDOMSummary (line 9726) | function getDOMSummary(measurements) {
function getExclusiveSummary (line 9742) | function getExclusiveSummary(measurements) {
function getInclusiveSummary (line 9790) | function getInclusiveSummary(measurements, onlyClean) {
function getUnchangedComponents (line 9845) | function getUnchangedComponents(measurement) {
function getDeclarationErrorAddendum (line 10208) | function getDeclarationErrorAddendum() {
function validateExplicitKey (line 10237) | function validateExplicitKey(element, parentType) {
function getAddendaForKeyUse (line 10261) | function getAddendaForKeyUse(messageType, element, parentType) {
function validateChildKeys (line 10302) | function validateChildKeys(node, parentType) {
function checkPropTypes (line 10344) | function checkPropTypes(componentName, propTypes, props, location) {
function validatePropTypes (line 10378) | function validatePropTypes(element) {
function invokeGuardedCallback (line 10514) | function invokeGuardedCallback(name, func, a, b) {
function runEventQueueInBatch (line 10583) | function runEventQueueInBatch(events) {
function findParent (line 10631) | function findParent(inst) {
function TopLevelCallbackBookKeeping (line 10644) | function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
function handleTopLevelImpl (line 10658) | function handleTopLevelImpl(bookKeeping) {
function scrollValueMonitor (line 10678) | function scrollValueMonitor(cb) {
function isInDocument (line 10840) | function isInDocument(node) {
function firstDifferenceIndex (line 11151) | function firstDifferenceIndex(string1, string2) {
function getReactRootElementInContainer (line 11166) | function getReactRootElementInContainer(container) {
function internalGetID (line 11178) | function internalGetID(node) {
function mountComponentIntoNode (line 11193) | function mountComponentIntoNode(wrapperInstance, container, transaction,...
function batchedMountComponentIntoNode (line 11219) | function batchedMountComponentIntoNode(componentInstance, container, sho...
function unmountComponentFromNode (line 11236) | function unmountComponentFromNode(instance, container, safely) {
function hasNonRootReactChild (line 11259) | function hasNonRootReactChild(container) {
function getNativeRootInstanceInContainer (line 11267) | function getNativeRootInstanceInContainer(container) {
function getTopLevelWrapperInContainer (line 11273) | function getTopLevelWrapperInContainer(container) {
function makeInsertMarkup (line 11609) | function makeInsertMarkup(markup, afterNode, toIndex) {
function makeMove (line 11628) | function makeMove(child, afterNode, toIndex) {
function makeRemove (line 11646) | function makeRemove(child, node) {
function makeSetMarkup (line 11664) | function makeSetMarkup(markup) {
function makeTextContent (line 11682) | function makeTextContent(textContent) {
function enqueue (line 11698) | function enqueue(queue, update) {
function processQueue (line 11711) | function processQueue(inst, updateQueue) {
function getComponentClassForElement (line 12062) | function getComponentClassForElement(element) {
function createInternalComponent (line 12080) | function createInternalComponent(element) {
function createInstanceForText (line 12089) | function createInstanceForText(text) {
function isTextComponent (line 12097) | function isTextComponent(component) {
function warnTDZ (line 12164) | function warnTDZ(publicInstance, callerName) {
function _noMeasure (line 12429) | function _noMeasure(objName, fnName, func) {
function is (line 12575) | function is(x, y) {
function createChainableTypeChecker (line 12588) | function createChainableTypeChecker(validate) {
function createPrimitiveTypeChecker (line 12609) | function createPrimitiveTypeChecker(expectedType) {
function createAnyTypeChecker (line 12627) | function createAnyTypeChecker() {
function createArrayOfTypeChecker (line 12631) | function createArrayOfTypeChecker(typeChecker) {
function createElementTypeChecker (line 12653) | function createElementTypeChecker() {
function createInstanceTypeChecker (line 12664) | function createInstanceTypeChecker(expectedClass) {
function createEnumTypeChecker (line 12677) | function createEnumTypeChecker(expectedValues) {
function createObjectOfTypeChecker (line 12699) | function createObjectOfTypeChecker(typeChecker) {
function createUnionTypeChecker (line 12723) | function createUnionTypeChecker(arrayOfTypeCheckers) {
function createNodeChecker (line 12744) | function createNodeChecker() {
function createShapeTypeChecker (line 12755) | function createShapeTypeChecker(shapeTypes) {
function isNode (line 12778) | function isNode(propValue) {
function getPropType (line 12826) | function getPropType(propValue) {
function getPreciseType (line 12842) | function getPreciseType(propValue) {
function getClassName (line 12855) | function getClassName(propValue) {
function ReactReconcileTransaction (line 12967) | function ReactReconcileTransaction(useCreateElement) {
function attachRefs (line 13047) | function attachRefs() {
function attachRef (line 13175) | function attachRef(ref, component, owner) {
function detachRef (line 13184) | function detachRef(ref, component, owner) {
function renderToStringImpl (line 13288) | function renderToStringImpl(element, makeStaticMarkup) {
function renderToString (line 13311) | function renderToString(element) {
function renderToStaticMarkup (line 13316) | function renderToStaticMarkup(element) {
function ReactServerRenderingTransaction (line 13359) | function ReactServerRenderingTransaction(renderToStaticMarkup) {
function enqueueUpdate (line 13443) | function enqueueUpdate(internalInstance) {
function formatUnexpectedArgument (line 13447) | function formatUnexpectedArgument(arg) {
function getInternalInstanceReadyForUpdate (line 13460) | function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
function ensureInjected (line 13669) | function ensureInjected() {
function ReactUpdatesFlushTransaction (line 13703) | function ReactUpdatesFlushTransaction() {
function batchedUpdates (line 13733) | function batchedUpdates(callback, a, b, c, d, e) {
function mountOrderComparator (line 13745) | function mountOrderComparator(c1, c2) {
function runBatchedUpdates (line 13749) | function runBatchedUpdates(transaction) {
function enqueueUpdate (line 13822) | function enqueueUpdate(component) {
function asap (line 13843) | function asap(callback, context) {
function getSelection (line 14255) | function getSelection(node) {
function constructSelectEvent (line 14286) | function constructSelectEvent(nativeEvent, nativeEventTarget) {
function SyntheticAnimationEvent (line 15054) | function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeE...
function SyntheticClipboardEvent (line 15093) | function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeE...
function SyntheticCompositionEvent (line 15130) | function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativ...
function SyntheticDragEvent (line 15167) | function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent,...
function SyntheticEvent (line 15237) | function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeE...
function getPooledWarningPropertyDefinition (line 15410) | function getPooledWarningPropertyDefinition(propName, getVal) {
function SyntheticFocusEvent (line 15466) | function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticInputEvent (line 15504) | function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticKeyboardEvent (line 15589) | function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEv...
function SyntheticMouseEvent (line 15662) | function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticTouchEvent (line 15708) | function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticTransitionEvent (line 15748) | function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, native...
function SyntheticUIEvent (line 15808) | function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, n...
function SyntheticWheelEvent (line 15863) | function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent...
function accumulateInto (line 16160) | function accumulateInto(current, next) {
function adler32 (line 16211) | function adler32(data) {
function dangerousStyleValue (line 16322) | function dangerousStyleValue(name, value, component) {
function escaper (line 16394) | function escaper(match) {
function escapeTextContentForBrowser (line 16404) | function escapeTextContentForBrowser(text) {
function findDOMNode (line 16437) | function findDOMNode(componentOrElement) {
function flattenSingleChildIntoContext (line 16488) | function flattenSingleChildIntoContext(traverseContext, child, name) {
function flattenChildren (line 16505) | function flattenChildren(children) {
function getEventCharCode (line 16571) | function getEventCharCode(nativeEvent) {
function getEventKey (line 16670) | function getEventKey(nativeEvent) {
function modifierStateGetter (line 16729) | function modifierStateGetter(keyArg) {
function getEventModifierState (line 16739) | function getEventModifierState(nativeEvent) {
function getEventTarget (line 16766) | function getEventTarget(nativeEvent) {
function getIteratorFn (line 16813) | function getIteratorFn(maybeIterable) {
function getNativeComponentFromComposite (line 16837) | function getNativeComponentFromComposite(inst) {
function getLeafNode (line 16873) | function getLeafNode(node) {
function getSiblingNode (line 16887) | function getSiblingNode(node) {
function getNodeForCharacterOffset (line 16903) | function getNodeForCharacterOffset(root, offset) {
function getTextContentAccessor (line 16951) | function getTextContentAccessor() {
function makePrefixMap (line 16984) | function makePrefixMap(styleProp, eventName) {
function getVendorPrefixedEventName (line 17044) | function getVendorPrefixedEventName(eventName) {
function getDeclarationErrorAddendum (line 17094) | function getDeclarationErrorAddendum(owner) {
function isInternalComponentType (line 17111) | function isInternalComponentType(type) {
function instantiateReactComponent (line 17122) | function instantiateReactComponent(node) {
function isEventSupported (line 17213) | function isEventSupported(eventNameSuffix, capture) {
function isTextInputElement (line 17272) | function isTextInputElement(elem) {
function onlyChild (line 17306) | function onlyChild(children) {
function quoteAttributeValueForBrowser (line 17334) | function quoteAttributeValueForBrowser(value) {
function shouldUpdateReactComponent (line 17506) | function shouldUpdateReactComponent(prevElement, nextElement) {
function userProvidedKeyEscaper (line 17561) | function userProvidedKeyEscaper(match) {
function getComponentKey (line 17572) | function getComponentKey(component, index) {
function escapeUserProvidedKey (line 17589) | function escapeUserProvidedKey(text) {
function wrapUserProvidedKey (line 17600) | function wrapUserProvidedKey(key) {
function traverseAllChildrenImpl (line 17612) | function traverseAllChildrenImpl(children, nameSoFar, callback, traverse...
function traverseAllChildren (line 17704) | function traverseAllChildren(children, callback, traverseContext) {
function camelize (line 18227) | function camelize(string) {
function camelizeStyleName (line 18269) | function camelizeStyleName(string) {
function containsNode (line 18299) | function containsNode(outerNode, innerNode) {
function toArray (line 18343) | function toArray(obj) {
function hasArrayNature (line 18391) | function hasArrayNature(obj) {
function createArrayFromMixed (line 18434) | function createArrayFromMixed(obj) {
function getNodeName (line 18483) | function getNodeName(markup) {
function createNodesFromMarkup (line 18498) | function createNodesFromMarkup(markup, handleScript) {
function makeEmptyFunction (line 18542) | function makeEmptyFunction(arg) {
function emptyFunction (line 18553) | function emptyFunction() {}
function focusNode (line 18604) | function focusNode(node) {
function getActiveElement (line 18637) | function getActiveElement() /*?DOMElement*/{
function getMarkupWrap (line 18727) | function getMarkupWrap(nodeName) {
function getUnboundedScrollPosition (line 18769) | function getUnboundedScrollPosition(scrollable) {
function hyphenate (line 18811) | function hyphenate(string) {
function hyphenateStyleName (line 18850) | function hyphenateStyleName(string) {
function invariant (line 18879) | function invariant(condition, format, a, b, c, d, e, f) {
function isNode (line 18923) | function isNode(object) {
function isTextNode (line 18948) | function isTextNode(object) {
function mapObject (line 19073) | function mapObject(object, callback, context) {
function memoizeStringOnly (line 19108) | function memoizeStringOnly(callback) {
function is (line 19199) | function is(x, y) {
function shallowEqual (line 19216) | function shallowEqual(objA, objB) {
function toObject (line 19306) | function toObject(val) {
FILE: demo13/app.js
function defineProperties (line 7) | function defineProperties(target, props) { for (var i = 0; i < props.len...
function _interopRequireDefault (line 13) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function _classCallCheck (line 15) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function _possibleConstructorReturn (line 17) | function _possibleConstructorReturn(self, call) { if (!self) { throw new...
function _inherits (line 19) | function _inherits(subClass, superClass) { if (typeof superClass !== "fu...
function App (line 24) | function App(props) {
FILE: demo13/browser.js
function _interopRequireDefault (line 15) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
FILE: demo13/server.js
function _interopRequireDefault (line 7) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
FILE: demo13/src/app.js
class App (line 3) | class App extends React.Component{
method constructor (line 5) | constructor(props) {
method componentDidMount (line 14) | componentDidMount() {
method handleClick (line 20) | handleClick() {
method render (line 26) | render() {
Condensed preview — 27 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,620K chars).
[
{
"path": ".gitignore",
"chars": 22,
"preview": "example/\nnode_modules\n"
},
{
"path": "README.md",
"chars": 19682,
"preview": "This is a collection of simple demos of React.js.\n\nThese demos are purposely written in a simple and clear style. You wi"
},
{
"path": "build/prop-types.js",
"chars": 29843,
"preview": "(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"func"
},
{
"path": "build/react-dom.development.js",
"chars": 744015,
"preview": "/** @license React v16.7.0\n * react-dom.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This"
},
{
"path": "build/react.development.js",
"chars": 100351,
"preview": "/** @license React v16.7.0\n * react.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This sou"
},
{
"path": "build/react.js",
"chars": 656686,
"preview": " /**\n * React v15.0.1\n */\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}e"
},
{
"path": "demo01/index.html",
"chars": 449,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\" />\n <script src=\"../build/react.development.js\"></script>\n "
},
{
"path": "demo02/index.html",
"chars": 629,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\" />\n <script src=\"../build/react.development.js\"></script>\n "
},
{
"path": "demo03/index.html",
"chars": 552,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\" />\n <script src=\"../build/react.development.js\"></script>\n "
},
{
"path": "demo04/index.html",
"chars": 595,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\" />\n <script src=\"../build/react.development.js\"></script>\n "
},
{
"path": "demo05/index.html",
"chars": 840,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\" />\n <script src=\"../build/react.development.js\"></script>\n "
},
{
"path": "demo06/index.html",
"chars": 745,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\" />\n <script src=\"../build/react.development.js\"></script>\n "
},
{
"path": "demo07/index.html",
"chars": 1072,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\" />\n <script src=\"../build/react.development.js\"></script>\n "
},
{
"path": "demo08/index.html",
"chars": 1011,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\" />\n <script src=\"../build/react.development.js\"></script>\n "
},
{
"path": "demo09/index.html",
"chars": 1000,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\" />\n <script src=\"../build/react.development.js\"></script>\n "
},
{
"path": "demo10/index.html",
"chars": 1154,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\" />\n <script src=\"../build/react.development.js\"></script>\n "
},
{
"path": "demo11/index.html",
"chars": 1237,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\" />\n <script src=\"../build/react.development.js\"></script>\n "
},
{
"path": "demo12/index.html",
"chars": 1783,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\" />\n <script src=\"../build/react.development.js\"></script>\n "
},
{
"path": "demo13/.babelrc",
"chars": 48,
"preview": "{\n \"presets\": [\n \"es2015\",\n \"react\"\n ]\n}"
},
{
"path": "demo13/README.md",
"chars": 333,
"preview": "This demo is copied from [github.com/mhart/react-server-example](https://github.com/mhart/react-server-example), but I r"
},
{
"path": "demo13/app.js",
"chars": 3130,
"preview": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { functi"
},
{
"path": "demo13/browser.js",
"chars": 499,
"preview": "'use strict';\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactDom = require('r"
},
{
"path": "demo13/package.json",
"chars": 542,
"preview": "{\n \"name\": \"react-server\",\n \"version\": \"1.0.0\",\n \"description\": \"an example of react.js in server\",\n \"main\": \"server"
},
{
"path": "demo13/server.js",
"chars": 1733,
"preview": "'use strict';\n\nvar _app = require('./app');\n\nvar _app2 = _interopRequireDefault(_app);\n\nfunction _interopRequireDefault("
},
{
"path": "demo13/src/app.js",
"chars": 774,
"preview": "import React from 'react';\n\nexport default class App extends React.Component{\n\n constructor(props) {\n super(props);\n"
},
{
"path": "demo13/src/browser.js",
"chars": 180,
"preview": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './app';\n\nReactDOM.render(<App items={windo"
},
{
"path": "demo13/src/server.js",
"chars": 1475,
"preview": "var http = require('http'),\n browserify = require('browserify'),\n literalify = require('literalify'),\n React = "
}
]
About this extraction
This page contains the full source code of the ruanyf/react-demos GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 27 files (1.5 MB), approximately 374.4k tokens, and a symbol index with 1004 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.