Commit 83b21e90 authored by Yamagishi Kazutoshi's avatar Yamagishi Kazutoshi Committed by GitHub
Browse files

Bump React from 16.14.0 to 18.1.0

parent f804c009
Showing with 41 additions and 47 deletions
+41 -47
// @ts-check
import { decode } from 'blurhash';
import React, { useRef, useEffect } from 'react';
import { memo, useRef, useEffect } from 'react';
import PropTypes from 'prop-types';
/**
......@@ -62,4 +62,4 @@ Blurhash.propTypes = {
dummy: PropTypes.bool,
};
export default React.memo(Blurhash);
export default memo(Blurhash);
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
export default class Button extends React.PureComponent {
export default class Button extends PureComponent {
static propTypes = {
text: PropTypes.node,
......
import React from 'react';
const Check = () => (
<svg width='14' height='11' viewBox='0 0 14 11'>
<path d='M11.264 0L5.26 6.004 2.103 2.847 0 4.95l5.26 5.26 8.108-8.107L11.264 0' fill='currentColor' fillRule='evenodd' />
......
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { supportsPassiveEvents } from 'detect-passive-events';
import { scrollTop } from '../scroll';
export default class Column extends React.PureComponent {
export default class Column extends PureComponent {
static propTypes = {
children: PropTypes.node,
......
import React from 'react';
import { PureComponent } from 'react';
import { FormattedMessage } from 'react-intl';
import PropTypes from 'prop-types';
import Icon from 'mastodon/components/icon';
import { createPortal } from 'react-dom';
export default class ColumnBackButton extends React.PureComponent {
export default class ColumnBackButton extends PureComponent {
static contextTypes = {
router: PropTypes.object,
......
import React from 'react';
import { FormattedMessage } from 'react-intl';
import ColumnBackButton from './column_back_button';
import Icon from 'mastodon/components/icon';
......
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { createPortal } from 'react-dom';
import classNames from 'classnames';
......@@ -13,7 +13,7 @@ const messages = defineMessages({
});
export default @injectIntl
class ColumnHeader extends React.PureComponent {
class ColumnHeader extends PureComponent {
static contextTypes = {
router: PropTypes.object,
......
// @ts-check
import React from 'react';
import { FormattedMessage } from 'react-intl';
/**
......
import React from 'react';
import { PureComponent } from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import { autoPlayGif } from 'mastodon/initial_state';
export default class DisplayName extends React.PureComponent {
export default class DisplayName extends PureComponent {
static propTypes = {
account: ImmutablePropTypes.map.isRequired,
......
import React from 'react';
import PropTypes from 'prop-types';
import IconButton from './icon_button';
import { defineMessages, injectIntl } from 'react-intl';
......
import React from 'react';
import { Children, PureComponent, cloneElement } from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import IconButton from './icon_button';
......@@ -12,7 +12,7 @@ import { CircularProgress } from 'mastodon/components/loading_indicator';
const listenerOptions = supportsPassiveEvents ? { passive: true } : false;
let id = 0;
class DropdownMenu extends React.PureComponent {
class DropdownMenu extends PureComponent {
static contextTypes = {
router: PropTypes.object,
......@@ -178,7 +178,7 @@ class DropdownMenu extends React.PureComponent {
}
export default class Dropdown extends React.PureComponent {
export default class Dropdown extends PureComponent {
static contextTypes = {
router: PropTypes.object,
......@@ -313,7 +313,7 @@ export default class Dropdown extends React.PureComponent {
const open = this.state.id === openDropdownId;
const button = children ? React.cloneElement(React.Children.only(children), {
const button = children ? cloneElement(Children.only(children), {
ref: this.setTargetRef,
onClick: this.handleClick,
onMouseDown: this.handleMouseDown,
......@@ -335,7 +335,7 @@ export default class Dropdown extends React.PureComponent {
);
return (
<React.Fragment>
<>
{button}
<Overlay show={open} placement={dropdownPlacement} target={this.findTarget}>
......@@ -350,7 +350,7 @@ export default class Dropdown extends React.PureComponent {
onItemClick={this.handleItemClick}
/>
</Overlay>
</React.Fragment>
</>
);
}
......
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage, injectIntl } from 'react-intl';
import Icon from 'mastodon/components/icon';
......@@ -18,7 +18,7 @@ const mapDispatchToProps = (dispatch, { statusId }) => ({
export default @connect(null, mapDispatchToProps)
@injectIntl
class EditedTimestamp extends React.PureComponent {
class EditedTimestamp extends PureComponent {
static propTypes = {
statusId: PropTypes.string.isRequired,
......
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { version, source_url } from 'mastodon/initial_state';
import StackTrace from 'stacktrace-js';
export default class ErrorBoundary extends React.PureComponent {
export default class ErrorBoundary extends PureComponent {
static propTypes = {
children: PropTypes.node,
......
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
export default class GIFV extends React.PureComponent {
export default class GIFV extends PureComponent {
static propTypes = {
src: PropTypes.string.isRequired,
......@@ -19,7 +19,7 @@ export default class GIFV extends React.PureComponent {
this.setState({ loading: false });
}
componentWillReceiveProps (nextProps) {
UNSAFE_componentWillReceiveProps (nextProps) {
if (nextProps.src !== this.props.src) {
this.setState({ loading: true });
}
......
// @ts-check
import React from 'react';
import { Component } from 'react';
import { Sparklines, SparklinesCurve } from 'react-sparklines';
import { FormattedMessage } from 'react-intl';
import PropTypes from 'prop-types';
......@@ -9,7 +9,7 @@ import ShortNumber from 'mastodon/components/short_number';
import Skeleton from 'mastodon/components/skeleton';
import classNames from 'classnames';
class SilentErrorBoundary extends React.Component {
class SilentErrorBoundary extends Component {
static propTypes = {
children: PropTypes.node,
......@@ -68,7 +68,7 @@ const Hashtag = ({ name, href, to, people, uses, history, className }) => (
<div className={classNames('trends__item', className)}>
<div className='trends__item__name'>
<Permalink href={href} to={to}>
{name ? <React.Fragment>#<span>{name}</span></React.Fragment> : <Skeleton width={50} />}
{name ? <>#<span>{name}</span></> : <Skeleton width={50} />}
</Permalink>
{typeof people !== 'undefined' ? <ShortNumber value={people} renderer={accountsCountRenderer} /> : <Skeleton width={100} />}
......
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
export default class Icon extends React.PureComponent {
export default class Icon extends PureComponent {
static propTypes = {
id: PropTypes.string.isRequired,
......
import React from 'react';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Icon from 'mastodon/components/icon';
import AnimatedNumber from 'mastodon/components/animated_number';
export default class IconButton extends React.PureComponent {
export default class IconButton extends PureComponent {
static propTypes = {
className: PropTypes.string,
......@@ -44,7 +44,7 @@ export default class IconButton extends React.PureComponent {
deactivate: false,
}
componentWillReceiveProps (nextProps) {
UNSAFE_componentWillReceiveProps (nextProps) {
if (!nextProps.animate) return;
if (this.props.active && !nextProps.active) {
......@@ -126,9 +126,9 @@ export default class IconButton extends React.PureComponent {
}
let contents = (
<React.Fragment>
<>
<Icon id={icon} fixedWidth aria-hidden='true' /> {typeof counter !== 'undefined' && <span className='icon-button__counter'><AnimatedNumber value={counter} obfuscate={obfuscateCount} /></span>}
</React.Fragment>
</>
);
if (href) {
......
import React from 'react';
import PropTypes from 'prop-types';
import Icon from 'mastodon/components/icon';
......
import React from 'react';
import { PureComponent } from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';
import { makeGetAccount } from 'mastodon/selectors';
......@@ -15,7 +15,7 @@ const makeMapStateToProps = () => {
};
export default @connect(makeMapStateToProps)
class InlineAccount extends React.PureComponent {
class InlineAccount extends PureComponent {
static propTypes = {
account: ImmutablePropTypes.map.isRequired,
......
import React from 'react';
import { cloneElement, Component } from 'react';
import PropTypes from 'prop-types';
import scheduleIdleTask from '../features/ui/util/schedule_idle_task';
import getRectFromEntry from '../features/ui/util/get_rect_from_entry';
......@@ -6,7 +6,7 @@ import getRectFromEntry from '../features/ui/util/get_rect_from_entry';
// Diff these props in the "unrendered" state
const updateOnPropsForUnrendered = ['id', 'index', 'listLength', 'cachedHeight'];
export default class IntersectionObserverArticle extends React.Component {
export default class IntersectionObserverArticle extends Component {
static propTypes = {
intersectionObserverWrapper: PropTypes.object.isRequired,
......@@ -115,14 +115,14 @@ export default class IntersectionObserverArticle extends React.Component {
data-id={id}
tabIndex='0'
>
{children && React.cloneElement(children, { hidden: true })}
{children && cloneElement(children, { hidden: true })}
</article>
);
}
return (
<article ref={this.handleRef} aria-posinset={index + 1} aria-setsize={listLength} data-id={id} tabIndex='0'>
{children && React.cloneElement(children, { hidden: false })}
{children && cloneElement(children, { hidden: false })}
</article>
);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment