Browse Source

Use the new JSX transform (#25064)

Renaud Chaput 1 year ago
parent
commit
8f66126b10
100 changed files with 138 additions and 187 deletions
  1. 8 0
      .eslintrc.js
  2. 0 1
      app/javascript/mastodon/components/__tests__/autosuggest_emoji-test.jsx
  3. 0 1
      app/javascript/mastodon/components/__tests__/avatar-test.jsx
  4. 0 1
      app/javascript/mastodon/components/__tests__/avatar_overlay-test.jsx
  5. 0 1
      app/javascript/mastodon/components/__tests__/button-test.jsx
  6. 0 1
      app/javascript/mastodon/components/__tests__/display_name-test.jsx
  7. 0 1
      app/javascript/mastodon/components/account.jsx
  8. 8 8
      app/javascript/mastodon/components/admin/Counter.jsx
  9. 2 2
      app/javascript/mastodon/components/admin/Dimension.jsx
  10. 4 4
      app/javascript/mastodon/components/admin/ReportReasonSelector.jsx
  11. 2 2
      app/javascript/mastodon/components/admin/Retention.jsx
  12. 2 2
      app/javascript/mastodon/components/admin/Trends.jsx
  13. 1 1
      app/javascript/mastodon/components/animated_number.tsx
  14. 0 1
      app/javascript/mastodon/components/attachment_list.jsx
  15. 2 2
      app/javascript/mastodon/components/autosuggest_emoji.jsx
  16. 2 2
      app/javascript/mastodon/components/autosuggest_hashtag.jsx
  17. 0 1
      app/javascript/mastodon/components/autosuggest_input.jsx
  18. 0 1
      app/javascript/mastodon/components/autosuggest_textarea.jsx
  19. 0 2
      app/javascript/mastodon/components/avatar.tsx
  20. 2 2
      app/javascript/mastodon/components/avatar_composite.jsx
  21. 0 2
      app/javascript/mastodon/components/avatar_overlay.tsx
  22. 2 2
      app/javascript/mastodon/components/blurhash.tsx
  23. 2 2
      app/javascript/mastodon/components/button.jsx
  24. 0 2
      app/javascript/mastodon/components/check.tsx
  25. 2 2
      app/javascript/mastodon/components/column.jsx
  26. 2 2
      app/javascript/mastodon/components/column_back_button.jsx
  27. 0 1
      app/javascript/mastodon/components/column_back_button_slim.jsx
  28. 2 2
      app/javascript/mastodon/components/column_header.jsx
  29. 0 1
      app/javascript/mastodon/components/common_counter.jsx
  30. 2 2
      app/javascript/mastodon/components/dismissable_banner.jsx
  31. 1 1
      app/javascript/mastodon/components/domain.tsx
  32. 6 6
      app/javascript/mastodon/components/dropdown_menu.jsx
  33. 2 2
      app/javascript/mastodon/components/edited_timestamp/index.jsx
  34. 2 2
      app/javascript/mastodon/components/error_boundary.jsx
  35. 1 1
      app/javascript/mastodon/components/gifv.tsx
  36. 3 3
      app/javascript/mastodon/components/hashtag.jsx
  37. 0 2
      app/javascript/mastodon/components/icon.tsx
  38. 4 4
      app/javascript/mastodon/components/icon_button.tsx
  39. 0 2
      app/javascript/mastodon/components/icon_with_badge.tsx
  40. 2 2
      app/javascript/mastodon/components/inline_account.jsx
  41. 4 4
      app/javascript/mastodon/components/intersection_observer_article.jsx
  42. 2 2
      app/javascript/mastodon/components/load_gap.jsx
  43. 2 2
      app/javascript/mastodon/components/load_more.jsx
  44. 2 2
      app/javascript/mastodon/components/load_pending.jsx
  45. 0 1
      app/javascript/mastodon/components/loading_indicator.jsx
  46. 0 2
      app/javascript/mastodon/components/logo.tsx
  47. 0 1
      app/javascript/mastodon/components/media_attachments.jsx
  48. 3 3
      app/javascript/mastodon/components/media_gallery.jsx
  49. 2 2
      app/javascript/mastodon/components/modal_root.jsx
  50. 2 2
      app/javascript/mastodon/components/navigation_portal.jsx
  51. 0 2
      app/javascript/mastodon/components/not_signed_in_indicator.tsx
  52. 2 2
      app/javascript/mastodon/components/picture_in_picture_placeholder.jsx
  53. 0 1
      app/javascript/mastodon/components/poll.jsx
  54. 0 2
      app/javascript/mastodon/components/radio_button.tsx
  55. 0 1
      app/javascript/mastodon/components/regeneration_indicator.jsx
  56. 2 2
      app/javascript/mastodon/components/relative_timestamp.tsx
  57. 6 6
      app/javascript/mastodon/components/scrollable_list.jsx
  58. 2 2
      app/javascript/mastodon/components/server_banner.jsx
  59. 1 1
      app/javascript/mastodon/components/server_hero_image.tsx
  60. 2 2
      app/javascript/mastodon/components/short_number.jsx
  61. 0 2
      app/javascript/mastodon/components/skeleton.tsx
  62. 0 1
      app/javascript/mastodon/components/status.jsx
  63. 0 1
      app/javascript/mastodon/components/status_action_bar.jsx
  64. 3 3
      app/javascript/mastodon/components/status_content.jsx
  65. 0 1
      app/javascript/mastodon/components/status_list.jsx
  66. 0 2
      app/javascript/mastodon/components/timeline_hint.tsx
  67. 0 2
      app/javascript/mastodon/components/verified_badge.tsx
  68. 0 1
      app/javascript/mastodon/containers/account_container.jsx
  69. 2 2
      app/javascript/mastodon/containers/admin_component.jsx
  70. 2 2
      app/javascript/mastodon/containers/compose_container.jsx
  71. 0 1
      app/javascript/mastodon/containers/domain_container.jsx
  72. 2 2
      app/javascript/mastodon/containers/mastodon.jsx
  73. 1 1
      app/javascript/mastodon/containers/media_container.jsx
  74. 0 1
      app/javascript/mastodon/containers/status_container.jsx
  75. 3 3
      app/javascript/mastodon/features/about/index.jsx
  76. 2 2
      app/javascript/mastodon/features/account/components/account_note.jsx
  77. 0 1
      app/javascript/mastodon/features/account/components/featured_tags.jsx
  78. 0 1
      app/javascript/mastodon/features/account/components/follow_request_note.jsx
  79. 3 3
      app/javascript/mastodon/features/account/components/header.jsx
  80. 2 2
      app/javascript/mastodon/features/account/navigation.jsx
  81. 0 1
      app/javascript/mastodon/features/account_gallery/components/media_item.jsx
  82. 0 1
      app/javascript/mastodon/features/account_gallery/index.jsx
  83. 0 1
      app/javascript/mastodon/features/account_timeline/components/header.jsx
  84. 2 2
      app/javascript/mastodon/features/account_timeline/components/limited_account_hint.jsx
  85. 0 1
      app/javascript/mastodon/features/account_timeline/components/memorial_note.jsx
  86. 0 1
      app/javascript/mastodon/features/account_timeline/components/moved_note.jsx
  87. 0 1
      app/javascript/mastodon/features/account_timeline/containers/header_container.jsx
  88. 0 1
      app/javascript/mastodon/features/account_timeline/index.jsx
  89. 2 2
      app/javascript/mastodon/features/audio/index.jsx
  90. 0 1
      app/javascript/mastodon/features/blocks/index.jsx
  91. 0 1
      app/javascript/mastodon/features/bookmarked_statuses/index.jsx
  92. 0 1
      app/javascript/mastodon/features/closed_registrations_modal/index.jsx
  93. 2 2
      app/javascript/mastodon/features/community_timeline/components/column_settings.jsx
  94. 2 2
      app/javascript/mastodon/features/community_timeline/index.jsx
  95. 2 2
      app/javascript/mastodon/features/compose/components/action_bar.jsx
  96. 0 1
      app/javascript/mastodon/features/compose/components/autosuggest_account.jsx
  97. 2 2
      app/javascript/mastodon/features/compose/components/character_counter.jsx
  98. 0 1
      app/javascript/mastodon/features/compose/components/compose_form.jsx
  99. 5 5
      app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.jsx
  100. 3 3
      app/javascript/mastodon/features/compose/components/language_dropdown.jsx

+ 8 - 0
.eslintrc.js

@@ -101,7 +101,12 @@ module.exports = {
     'react/jsx-equals-spacing': 'error',
     'react/jsx-no-bind': 'error',
     'react/jsx-no-target-blank': 'off',
+    'react/jsx-tag-spacing': 'error',
+    'react/jsx-uses-react': 'off', // not needed with new JSX transform
+    'react/jsx-wrap-multilines': 'error',
+    'react/no-deprecated': 'off',
     'react/no-unknown-property': 'off',
+    'react/react-in-jsx-scope': 'off', // not needed with new JSX transform
     'react/self-closing-comp': 'error',
 
     // recommended values found in https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/src/index.js
@@ -339,6 +344,9 @@ module.exports = {
         'import/no-default-export': 'warn',
         'react/prefer-stateless-function': 'warn',
         'react/function-component-definition': ['error', { namedComponents: 'arrow-function' }],
+        'react/jsx-uses-react': 'off', // not needed with new JSX transform
+        'react/react-in-jsx-scope': 'off', // not needed with new JSX transform
+        'react/prop-types': 'off',
       },
     },
     {

+ 0 - 1
app/javascript/mastodon/components/__tests__/autosuggest_emoji-test.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import renderer from 'react-test-renderer';
 import AutosuggestEmoji from '../autosuggest_emoji';
 

+ 0 - 1
app/javascript/mastodon/components/__tests__/avatar-test.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import renderer from 'react-test-renderer';
 import { fromJS } from 'immutable';
 import { Avatar } from '../avatar';

+ 0 - 1
app/javascript/mastodon/components/__tests__/avatar_overlay-test.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import renderer from 'react-test-renderer';
 import { fromJS } from 'immutable';
 import { AvatarOverlay } from '../avatar_overlay';

+ 0 - 1
app/javascript/mastodon/components/__tests__/button-test.jsx

@@ -1,5 +1,4 @@
 import { render, fireEvent, screen } from '@testing-library/react';
-import React from 'react';
 import renderer from 'react-test-renderer';
 import Button from '../button';
 

+ 0 - 1
app/javascript/mastodon/components/__tests__/display_name-test.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import renderer from 'react-test-renderer';
 import { fromJS }  from 'immutable';
 import { DisplayName } from '../display_name';

+ 0 - 1
app/javascript/mastodon/components/account.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import PropTypes from 'prop-types';
 import { Avatar } from './avatar';

+ 8 - 8
app/javascript/mastodon/components/admin/Counter.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent, Fragment } from 'react';
 import PropTypes from 'prop-types';
 import api from 'mastodon/api';
 import { FormattedNumber } from 'react-intl';
@@ -24,7 +24,7 @@ const percIncrease = (a, b) => {
   return percent;
 };
 
-export default class Counter extends React.PureComponent {
+export default class Counter extends PureComponent {
 
   static propTypes = {
     measure: PropTypes.string.isRequired,
@@ -62,25 +62,25 @@ export default class Counter extends React.PureComponent {
 
     if (loading) {
       content = (
-        <React.Fragment>
+        <Fragment>
           <span className='sparkline__value__total'><Skeleton width={43} /></span>
           <span className='sparkline__value__change'><Skeleton width={43} /></span>
-        </React.Fragment>
+        </Fragment>
       );
     } else {
       const measure = data[0];
       const percentChange = measure.previous_total && percIncrease(measure.previous_total * 1, measure.total * 1);
 
       content = (
-        <React.Fragment>
+        <Fragment>
           <span className='sparkline__value__total'>{measure.human_value || <FormattedNumber value={measure.total} />}</span>
           {measure.previous_total && (<span className={classNames('sparkline__value__change', { positive: percentChange > 0, negative: percentChange < 0 })}>{percentChange > 0 && '+'}<FormattedNumber value={percentChange} style='percent' /></span>)}
-        </React.Fragment>
+        </Fragment>
       );
     }
 
     const inner = (
-      <React.Fragment>
+      <Fragment>
         <div className='sparkline__value'>
           {content}
         </div>
@@ -96,7 +96,7 @@ export default class Counter extends React.PureComponent {
             </Sparklines>
           )}
         </div>
-      </React.Fragment>
+      </Fragment>
     );
 
     if (href) {

+ 2 - 2
app/javascript/mastodon/components/admin/Dimension.jsx

@@ -1,11 +1,11 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import api from 'mastodon/api';
 import { FormattedNumber } from 'react-intl';
 import { roundTo10 } from 'mastodon/utils/numbers';
 import { Skeleton } from 'mastodon/components/skeleton';
 
-export default class Dimension extends React.PureComponent {
+export default class Dimension extends PureComponent {
 
   static propTypes = {
     dimension: PropTypes.string.isRequired,

+ 4 - 4
app/javascript/mastodon/components/admin/ReportReasonSelector.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import api from 'mastodon/api';
 import { injectIntl, defineMessages } from 'react-intl';
@@ -10,7 +10,7 @@ const messages = defineMessages({
   violation: { id: 'report.categories.violation', defaultMessage: 'Content violates one or more server rules' },
 });
 
-class Category extends React.PureComponent {
+class Category extends PureComponent {
 
   static propTypes = {
     id: PropTypes.string.isRequired,
@@ -52,7 +52,7 @@ class Category extends React.PureComponent {
 
 }
 
-class Rule extends React.PureComponent {
+class Rule extends PureComponent {
 
   static propTypes = {
     id: PropTypes.string.isRequired,
@@ -84,7 +84,7 @@ class Rule extends React.PureComponent {
 
 }
 
-class ReportReasonSelector extends React.PureComponent {
+class ReportReasonSelector extends PureComponent {
 
   static propTypes = {
     id: PropTypes.string.isRequired,

+ 2 - 2
app/javascript/mastodon/components/admin/Retention.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import api from 'mastodon/api';
 import { FormattedMessage, FormattedNumber, FormattedDate } from 'react-intl';
@@ -14,7 +14,7 @@ const dateForCohort = cohort => {
   }
 };
 
-export default class Retention extends React.PureComponent {
+export default class Retention extends PureComponent {
 
   static propTypes = {
     start_at: PropTypes.string,

+ 2 - 2
app/javascript/mastodon/components/admin/Trends.jsx

@@ -1,11 +1,11 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import api from 'mastodon/api';
 import { FormattedMessage } from 'react-intl';
 import classNames from 'classnames';
 import Hashtag from 'mastodon/components/hashtag';
 
-export default class Trends extends React.PureComponent {
+export default class Trends extends PureComponent {
 
   static propTypes = {
     limit: PropTypes.number.isRequired,

+ 1 - 1
app/javascript/mastodon/components/animated_number.tsx

@@ -1,4 +1,4 @@
-import React, { useCallback, useState } from 'react';
+import { useCallback, useState } from 'react';
 
 import { TransitionMotion, spring } from 'react-motion';
 

+ 0 - 1
app/javascript/mastodon/components/attachment_list.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import PropTypes from 'prop-types';
 import ImmutablePureComponent from 'react-immutable-pure-component';

+ 2 - 2
app/javascript/mastodon/components/autosuggest_emoji.jsx

@@ -1,9 +1,9 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import unicodeMapping from '../features/emoji/emoji_unicode_mapping_light';
 import { assetHost } from 'mastodon/utils/config';
 
-export default class AutosuggestEmoji extends React.PureComponent {
+export default class AutosuggestEmoji extends PureComponent {
 
   static propTypes = {
     emoji: PropTypes.object.isRequired,

+ 2 - 2
app/javascript/mastodon/components/autosuggest_hashtag.jsx

@@ -1,9 +1,9 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import ShortNumber from 'mastodon/components/short_number';
 import { FormattedMessage } from 'react-intl';
 
-export default class AutosuggestHashtag extends React.PureComponent {
+export default class AutosuggestHashtag extends PureComponent {
 
   static propTypes = {
     tag: PropTypes.shape({

+ 0 - 1
app/javascript/mastodon/components/autosuggest_input.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import AutosuggestAccountContainer from '../features/compose/containers/autosuggest_account_container';
 import AutosuggestEmoji from './autosuggest_emoji';
 import AutosuggestHashtag from './autosuggest_hashtag';

+ 0 - 1
app/javascript/mastodon/components/autosuggest_textarea.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import AutosuggestAccountContainer from '../features/compose/containers/autosuggest_account_container';
 import AutosuggestEmoji from './autosuggest_emoji';
 import AutosuggestHashtag from './autosuggest_hashtag';

+ 0 - 2
app/javascript/mastodon/components/avatar.tsx

@@ -1,5 +1,3 @@
-import * as React from 'react';
-
 import classNames from 'classnames';
 
 import { useHovering } from '../../hooks/useHovering';

+ 2 - 2
app/javascript/mastodon/components/avatar_composite.jsx

@@ -1,10 +1,10 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import { autoPlayGif } from '../initial_state';
 import { Avatar } from './avatar';
 
-export default class AvatarComposite extends React.PureComponent {
+export default class AvatarComposite extends PureComponent {
 
   static propTypes = {
     accounts: ImmutablePropTypes.list.isRequired,

+ 0 - 2
app/javascript/mastodon/components/avatar_overlay.tsx

@@ -1,5 +1,3 @@
-import React from 'react';
-
 import { useHovering } from '../../hooks/useHovering';
 import type { Account } from '../../types/resources';
 import { autoPlayGif } from '../initial_state';

+ 2 - 2
app/javascript/mastodon/components/blurhash.tsx

@@ -1,4 +1,4 @@
-import React, { useRef, useEffect } from 'react';
+import { memo, useRef, useEffect } from 'react';
 
 import { decode } from 'blurhash';
 
@@ -43,6 +43,6 @@ const Blurhash: React.FC<Props> = ({
   );
 };
 
-const MemoizedBlurhash = React.memo(Blurhash);
+const MemoizedBlurhash = memo(Blurhash);
 
 export { MemoizedBlurhash as Blurhash };

+ 2 - 2
app/javascript/mastodon/components/button.jsx

@@ -1,8 +1,8 @@
-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,

+ 0 - 2
app/javascript/mastodon/components/check.tsx

@@ -1,5 +1,3 @@
-import React from 'react';
-
 export const Check: React.FC = () => (
   <svg
     xmlns='http://www.w3.org/2000/svg'

+ 2 - 2
app/javascript/mastodon/components/column.jsx

@@ -1,11 +1,11 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import { supportsPassiveEvents } from 'detect-passive-events';
 import { scrollTop } from '../scroll';
 
 const listenerOptions = supportsPassiveEvents ? { passive: true } : false;
 
-export default class Column extends React.PureComponent {
+export default class Column extends PureComponent {
 
   static propTypes = {
     children: PropTypes.node,

+ 2 - 2
app/javascript/mastodon/components/column_back_button.jsx

@@ -1,10 +1,10 @@
-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,

+ 0 - 1
app/javascript/mastodon/components/column_back_button_slim.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import { FormattedMessage } from 'react-intl';
 import ColumnBackButton from './column_back_button';
 import { Icon }  from 'mastodon/components/icon';

+ 2 - 2
app/javascript/mastodon/components/column_header.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import { createPortal } from 'react-dom';
 import classNames from 'classnames';
@@ -12,7 +12,7 @@ const messages = defineMessages({
   moveRight: { id: 'column_header.moveRight_settings', defaultMessage: 'Move column to the right' },
 });
 
-class ColumnHeader extends React.PureComponent {
+class ColumnHeader extends PureComponent {
 
   static contextTypes = {
     router: PropTypes.object,

+ 0 - 1
app/javascript/mastodon/components/common_counter.jsx

@@ -1,5 +1,4 @@
 // @ts-check
-import React from 'react';
 import { FormattedMessage } from 'react-intl';
 
 /**

+ 2 - 2
app/javascript/mastodon/components/dismissable_banner.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import { IconButton } from './icon_button';
 import PropTypes from 'prop-types';
 import { injectIntl, defineMessages } from 'react-intl';
@@ -8,7 +8,7 @@ const messages = defineMessages({
   dismiss: { id: 'dismissable_banner.dismiss', defaultMessage: 'Dismiss' },
 });
 
-class DismissableBanner extends React.PureComponent {
+class DismissableBanner extends PureComponent {
 
   static propTypes = {
     id: PropTypes.string.isRequired,

+ 1 - 1
app/javascript/mastodon/components/domain.tsx

@@ -1,4 +1,4 @@
-import React, { useCallback } from 'react';
+import { useCallback } from 'react';
 
 import type { InjectedIntl } from 'react-intl';
 import { defineMessages, injectIntl } from 'react-intl';

+ 6 - 6
app/javascript/mastodon/components/dropdown_menu.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent, cloneElement, Children, Fragment } from 'react';
 import PropTypes from 'prop-types';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import { IconButton } from './icon_button';
@@ -10,7 +10,7 @@ import { CircularProgress } from 'mastodon/components/loading_indicator';
 const listenerOptions = supportsPassiveEvents ? { passive: true, capture: true } : true;
 let id = 0;
 
-class DropdownMenu extends React.PureComponent {
+class DropdownMenu extends PureComponent {
 
   static contextTypes = {
     router: PropTypes.object,
@@ -155,7 +155,7 @@ class DropdownMenu extends React.PureComponent {
 
 }
 
-export default class Dropdown extends React.PureComponent {
+export default class Dropdown extends PureComponent {
 
   static contextTypes = {
     router: PropTypes.object,
@@ -286,7 +286,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), {
       onClick: this.handleClick,
       onMouseDown: this.handleMouseDown,
       onKeyDown: this.handleButtonKeyDown,
@@ -306,7 +306,7 @@ export default class Dropdown extends React.PureComponent {
     );
 
     return (
-      <React.Fragment>
+      <Fragment>
         <span ref={this.setTargetRef}>
           {button}
         </span>
@@ -329,7 +329,7 @@ export default class Dropdown extends React.PureComponent {
             </div>
           )}
         </Overlay>
-      </React.Fragment>
+      </Fragment>
     );
   }
 

+ 2 - 2
app/javascript/mastodon/components/edited_timestamp/index.jsx

@@ -1,4 +1,4 @@
-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';
@@ -16,7 +16,7 @@ const mapDispatchToProps = (dispatch, { statusId }) => ({
 
 });
 
-class EditedTimestamp extends React.PureComponent {
+class EditedTimestamp extends PureComponent {
 
   static propTypes = {
     statusId: PropTypes.string.isRequired,

+ 2 - 2
app/javascript/mastodon/components/error_boundary.jsx

@@ -1,11 +1,11 @@
-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';
 import { Helmet } from 'react-helmet';
 
-export default class ErrorBoundary extends React.PureComponent {
+export default class ErrorBoundary extends PureComponent {
 
   static propTypes = {
     children: PropTypes.node,

+ 1 - 1
app/javascript/mastodon/components/gifv.tsx

@@ -1,4 +1,4 @@
-import React, { useCallback, useState } from 'react';
+import { useCallback, useState } from 'react';
 
 interface Props {
   src: string;

+ 3 - 3
app/javascript/mastodon/components/hashtag.jsx

@@ -1,5 +1,5 @@
 // @ts-check
-import React from 'react';
+import { Component, Fragment } 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,
@@ -69,7 +69,7 @@ const Hashtag = ({ name, to, people, uses, history, className, description, with
   <div className={classNames('trends__item', className)}>
     <div className='trends__item__name'>
       <Link to={to}>
-        {name ? <React.Fragment>#<span>{name}</span></React.Fragment> : <Skeleton width={50} />}
+        {name ? <Fragment>#<span>{name}</span></Fragment> : <Skeleton width={50} />}
       </Link>
 
       {description ? (

+ 0 - 2
app/javascript/mastodon/components/icon.tsx

@@ -1,5 +1,3 @@
-import React from 'react';
-
 import classNames from 'classnames';
 
 interface Props extends React.HTMLAttributes<HTMLImageElement> {

+ 4 - 4
app/javascript/mastodon/components/icon_button.tsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
 
 import classNames from 'classnames';
 
@@ -32,7 +32,7 @@ interface States {
   activate: boolean;
   deactivate: boolean;
 }
-export class IconButton extends React.PureComponent<Props, States> {
+export class IconButton extends PureComponent<Props, States> {
   static defaultProps = {
     size: 18,
     active: false,
@@ -127,14 +127,14 @@ export class IconButton extends React.PureComponent<Props, States> {
     }
 
     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 != null) {

+ 0 - 2
app/javascript/mastodon/components/icon_with_badge.tsx

@@ -1,5 +1,3 @@
-import React from 'react';
-
 import { Icon } from './icon';
 
 const formatNumber = (num: number): number | string => (num > 40 ? '40+' : num);

+ 2 - 2
app/javascript/mastodon/components/inline_account.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import { connect } from 'react-redux';
 import { makeGetAccount } from 'mastodon/selectors';
@@ -14,7 +14,7 @@ const makeMapStateToProps = () => {
   return mapStateToProps;
 };
 
-class InlineAccount extends React.PureComponent {
+class InlineAccount extends PureComponent {
 
   static propTypes = {
     account: ImmutablePropTypes.map.isRequired,

+ 4 - 4
app/javascript/mastodon/components/intersection_observer_article.jsx

@@ -1,4 +1,4 @@
-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>
     );
   }

+ 2 - 2
app/javascript/mastodon/components/load_gap.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import { injectIntl, defineMessages } from 'react-intl';
 import { Icon }  from 'mastodon/components/icon';
@@ -7,7 +7,7 @@ const messages = defineMessages({
   load_more: { id: 'status.load_more', defaultMessage: 'Load more' },
 });
 
-class LoadGap extends React.PureComponent {
+class LoadGap extends PureComponent {
 
   static propTypes = {
     disabled: PropTypes.bool,

+ 2 - 2
app/javascript/mastodon/components/load_more.jsx

@@ -1,8 +1,8 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import { FormattedMessage } from 'react-intl';
 import PropTypes from 'prop-types';
 
-export default class LoadMore extends React.PureComponent {
+export default class LoadMore extends PureComponent {
 
   static propTypes = {
     onClick: PropTypes.func,

+ 2 - 2
app/javascript/mastodon/components/load_pending.jsx

@@ -1,8 +1,8 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import { FormattedMessage } from 'react-intl';
 import PropTypes from 'prop-types';
 
-export default class LoadPending extends React.PureComponent {
+export default class LoadPending extends PureComponent {
 
   static propTypes = {
     onClick: PropTypes.func,

+ 0 - 1
app/javascript/mastodon/components/loading_indicator.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import PropTypes from 'prop-types';
 
 export const CircularProgress = ({ size, strokeWidth }) => {

+ 0 - 2
app/javascript/mastodon/components/logo.tsx

@@ -1,5 +1,3 @@
-import React from 'react';
-
 import logo from 'mastodon/../images/logo.svg';
 
 export const WordmarkLogo: React.FC = () => (

+ 0 - 1
app/javascript/mastodon/components/media_attachments.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import PropTypes from 'prop-types';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import ImmutablePureComponent from 'react-immutable-pure-component';

+ 3 - 3
app/javascript/mastodon/components/media_gallery.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import PropTypes from 'prop-types';
 import { is } from 'immutable';
@@ -13,7 +13,7 @@ const messages = defineMessages({
   toggle_visible: { id: 'media_gallery.toggle_visible', defaultMessage: '{number, plural, one {Hide image} other {Hide images}}' },
 });
 
-class Item extends React.PureComponent {
+class Item extends PureComponent {
 
   static propTypes = {
     attachment: ImmutablePropTypes.map.isRequired,
@@ -196,7 +196,7 @@ class Item extends React.PureComponent {
 
 }
 
-class MediaGallery extends React.PureComponent {
+class MediaGallery extends PureComponent {
 
   static propTypes = {
     sensitive: PropTypes.bool,

+ 2 - 2
app/javascript/mastodon/components/modal_root.jsx

@@ -1,10 +1,10 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import 'wicg-inert';
 import { createBrowserHistory } from 'history';
 import { multiply } from 'color-blend';
 
-export default class ModalRoot extends React.PureComponent {
+export default class ModalRoot extends PureComponent {
 
   static contextTypes = {
     router: PropTypes.object,

+ 2 - 2
app/javascript/mastodon/components/navigation_portal.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import { Switch, Route, withRouter } from 'react-router-dom';
 import { showTrends } from 'mastodon/initial_state';
 import Trends from 'mastodon/features/getting_started/containers/trends_container';
@@ -15,7 +15,7 @@ const DefaultNavigation = () => (
   </>
 );
 
-class NavigationPortal extends React.PureComponent {
+class NavigationPortal extends PureComponent {
 
   render () {
     return (

+ 0 - 2
app/javascript/mastodon/components/not_signed_in_indicator.tsx

@@ -1,5 +1,3 @@
-import React from 'react';
-
 import { FormattedMessage } from 'react-intl';
 
 export const NotSignedInIndicator: React.FC = () => (

+ 2 - 2
app/javascript/mastodon/components/picture_in_picture_placeholder.jsx

@@ -1,11 +1,11 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import { Icon }  from 'mastodon/components/icon';
 import { removePictureInPicture } from 'mastodon/actions/picture_in_picture';
 import { connect } from 'react-redux';
 import { FormattedMessage } from 'react-intl';
 
-class PictureInPicturePlaceholder extends React.PureComponent {
+class PictureInPicturePlaceholder extends PureComponent {
 
   static propTypes = {
     dispatch: PropTypes.func.isRequired,

+ 0 - 1
app/javascript/mastodon/components/poll.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import PropTypes from 'prop-types';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import ImmutablePureComponent from 'react-immutable-pure-component';

+ 0 - 2
app/javascript/mastodon/components/radio_button.tsx

@@ -1,5 +1,3 @@
-import React from 'react';
-
 import classNames from 'classnames';
 
 interface Props {

+ 0 - 1
app/javascript/mastodon/components/regeneration_indicator.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import { FormattedMessage } from 'react-intl';
 import illustration from 'mastodon/../images/elephant_ui_working.svg';
 

+ 2 - 2
app/javascript/mastodon/components/relative_timestamp.tsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { Component } from 'react';
 
 import type { InjectedIntl } from 'react-intl';
 import { injectIntl, defineMessages } from 'react-intl';
@@ -199,7 +199,7 @@ interface Props {
 interface States {
   now: number;
 }
-class RelativeTimestamp extends React.Component<Props, States> {
+class RelativeTimestamp extends Component<Props, States> {
   state = {
     now: this.props.intl.now(),
   };

+ 6 - 6
app/javascript/mastodon/components/scrollable_list.jsx

@@ -1,4 +1,4 @@
-import React, { PureComponent } from 'react';
+import { Children, cloneElement, PureComponent } from 'react';
 import ScrollContainer from 'mastodon/containers/scroll_container';
 import PropTypes from 'prop-types';
 import IntersectionObserverArticleContainer from '../containers/intersection_observer_article_container';
@@ -184,8 +184,8 @@ class ScrollableList extends PureComponent {
   };
 
   getSnapshotBeforeUpdate (prevProps) {
-    const someItemInserted = React.Children.count(prevProps.children) > 0 &&
-      React.Children.count(prevProps.children) < React.Children.count(this.props.children) &&
+    const someItemInserted = Children.count(prevProps.children) > 0 &&
+      Children.count(prevProps.children) < Children.count(this.props.children) &&
       this.getFirstChildKey(prevProps) !== this.getFirstChildKey(this.props);
     const pendingChanged = (prevProps.numPending > 0) !== (this.props.numPending > 0);
 
@@ -293,7 +293,7 @@ class ScrollableList extends PureComponent {
   render () {
     const { children, scrollKey, trackScroll, showLoading, isLoading, hasMore, numPending, prepend, alwaysPrepend, append, emptyMessage, onLoadMore } = this.props;
     const { fullscreen } = this.state;
-    const childrenCount = React.Children.count(children);
+    const childrenCount = Children.count(children);
 
     const loadMore     = (hasMore && onLoadMore) ? <LoadMore visible={!isLoading} onClick={this.handleLoadMore} /> : null;
     const loadPending  = (numPending > 0) ? <LoadPending count={numPending} onClick={this.handleLoadPending} /> : null;
@@ -319,7 +319,7 @@ class ScrollableList extends PureComponent {
 
             {loadPending}
 
-            {React.Children.map(this.props.children, (child, index) => (
+            {Children.map(this.props.children, (child, index) => (
               <IntersectionObserverArticleContainer
                 key={child.key}
                 id={child.key}
@@ -328,7 +328,7 @@ class ScrollableList extends PureComponent {
                 intersectionObserverWrapper={this.intersectionObserverWrapper}
                 saveHeightKey={trackScroll ? `${this.context.router.route.location.key}:${scrollKey}` : null}
               >
-                {React.cloneElement(child, {
+                {cloneElement(child, {
                   getScrollPosition: this.getScrollPosition,
                   updateScrollBottom: this.updateScrollBottom,
                   cachedMediaWidth: this.state.cachedMediaWidth,

+ 2 - 2
app/javascript/mastodon/components/server_banner.jsx

@@ -1,5 +1,5 @@
 import PropTypes from 'prop-types';
-import React from 'react';
+import { PureComponent } from 'react';
 import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
 import { connect } from 'react-redux';
 import { fetchServer } from 'mastodon/actions/server';
@@ -18,7 +18,7 @@ const mapStateToProps = state => ({
   server: state.getIn(['server', 'server']),
 });
 
-class ServerBanner extends React.PureComponent {
+class ServerBanner extends PureComponent {
 
   static propTypes = {
     server: PropTypes.object,

+ 1 - 1
app/javascript/mastodon/components/server_hero_image.tsx

@@ -1,4 +1,4 @@
-import React, { useCallback, useState } from 'react';
+import { useCallback, useState } from 'react';
 
 import classNames from 'classnames';
 

+ 2 - 2
app/javascript/mastodon/components/short_number.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { memo } from 'react';
 import PropTypes from 'prop-types';
 import { toShortNumber, pluralReady, DECIMAL_UNITS } from '../utils/numbers';
 import { FormattedMessage, FormattedNumber } from 'react-intl';
@@ -109,4 +109,4 @@ ShortNumberCounter.propTypes = {
   value: PropTypes.arrayOf(PropTypes.number),
 };
 
-export default React.memo(ShortNumber);
+export default memo(ShortNumber);

+ 0 - 2
app/javascript/mastodon/components/skeleton.tsx

@@ -1,5 +1,3 @@
-import React from 'react';
-
 interface Props {
   width?: number | string;
   height?: number | string;

+ 0 - 1
app/javascript/mastodon/components/status.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import PropTypes from 'prop-types';
 import { Avatar } from './avatar';

+ 0 - 1
app/javascript/mastodon/components/status_action_bar.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import { connect } from 'react-redux';
 import PropTypes from 'prop-types';

+ 3 - 3
app/javascript/mastodon/components/status_content.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import PropTypes from 'prop-types';
 import { FormattedMessage, injectIntl } from 'react-intl';
@@ -11,7 +11,7 @@ import { autoPlayGif, languages as preloadedLanguages } from 'mastodon/initial_s
 
 const MAX_HEIGHT = 706; // 22px * 32 (+ 2px padding at the top)
 
-class TranslateButton extends React.PureComponent {
+class TranslateButton extends PureComponent {
 
   static propTypes = {
     translation: ImmutablePropTypes.map,
@@ -52,7 +52,7 @@ const mapStateToProps = state => ({
   languages: state.getIn(['server', 'translationLanguages', 'items']),
 });
 
-class StatusContent extends React.PureComponent {
+class StatusContent extends PureComponent {
 
   static contextTypes = {
     router: PropTypes.object,

+ 0 - 1
app/javascript/mastodon/components/status_list.jsx

@@ -1,5 +1,4 @@
 import { debounce } from 'lodash';
-import React from 'react';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import PropTypes from 'prop-types';
 import StatusContainer from '../containers/status_container';

+ 0 - 2
app/javascript/mastodon/components/timeline_hint.tsx

@@ -1,5 +1,3 @@
-import React from 'react';
-
 import { FormattedMessage } from 'react-intl';
 
 interface Props {

+ 0 - 2
app/javascript/mastodon/components/verified_badge.tsx

@@ -1,5 +1,3 @@
-import React from 'react';
-
 import { Icon } from './icon';
 
 interface Props {

+ 0 - 1
app/javascript/mastodon/containers/account_container.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import { connect } from 'react-redux';
 import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
 import { makeGetAccount } from '../selectors';

+ 2 - 2
app/javascript/mastodon/containers/admin_component.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import { IntlProvider, addLocaleData } from 'react-intl';
 import { getLocale } from '../locales';
@@ -6,7 +6,7 @@ import { getLocale } from '../locales';
 const { localeData, messages } = getLocale();
 addLocaleData(localeData);
 
-export default class AdminComponent extends React.PureComponent {
+export default class AdminComponent extends PureComponent {
 
   static propTypes = {
     locale: PropTypes.string.isRequired,

+ 2 - 2
app/javascript/mastodon/containers/compose_container.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import { Provider } from 'react-redux';
 import PropTypes from 'prop-types';
 import { store } from '../store';
@@ -18,7 +18,7 @@ if (initialState) {
 
 store.dispatch(fetchCustomEmojis());
 
-export default class TimelineContainer extends React.PureComponent {
+export default class TimelineContainer extends PureComponent {
 
   static propTypes = {
     locale: PropTypes.string.isRequired,

+ 0 - 1
app/javascript/mastodon/containers/domain_container.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import { connect } from 'react-redux';
 import { blockDomain, unblockDomain } from '../actions/domain_blocks';
 import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';

+ 2 - 2
app/javascript/mastodon/containers/mastodon.jsx

@@ -1,5 +1,5 @@
 import PropTypes from 'prop-types';
-import React from 'react';
+import { PureComponent } from 'react';
 import { Helmet } from 'react-helmet';
 import { IntlProvider, addLocaleData } from 'react-intl';
 import { Provider as ReduxProvider } from 'react-redux';
@@ -34,7 +34,7 @@ const createIdentityContext = state => ({
   permissions: state.role ? state.role.permissions : 0,
 });
 
-export default class Mastodon extends React.PureComponent {
+export default class Mastodon extends PureComponent {
 
   static propTypes = {
     locale: PropTypes.string.isRequired,

+ 1 - 1
app/javascript/mastodon/containers/media_container.jsx

@@ -1,4 +1,4 @@
-import React, { PureComponent, Fragment } from 'react';
+import { PureComponent, Fragment } from 'react';
 import { createPortal } from 'react-dom';
 import PropTypes from 'prop-types';
 import { IntlProvider, addLocaleData } from 'react-intl';

+ 0 - 1
app/javascript/mastodon/containers/status_container.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import { connect } from 'react-redux';
 import Status from '../components/status';
 import { makeGetStatus, makeGetPictureInPicture } from '../selectors';

+ 3 - 3
app/javascript/mastodon/features/about/index.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
 import { connect } from 'react-redux';
@@ -41,7 +41,7 @@ const mapStateToProps = state => ({
   domainBlocks: state.getIn(['server', 'domainBlocks']),
 });
 
-class Section extends React.PureComponent {
+class Section extends PureComponent {
 
   static propTypes = {
     title: PropTypes.string,
@@ -80,7 +80,7 @@ class Section extends React.PureComponent {
 
 }
 
-class About extends React.PureComponent {
+class About extends PureComponent {
 
   static propTypes = {
     server: ImmutablePropTypes.map,

+ 2 - 2
app/javascript/mastodon/features/account/components/account_note.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import PropTypes from 'prop-types';
 import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
@@ -10,7 +10,7 @@ const messages = defineMessages({
   placeholder: { id: 'account_note.placeholder', defaultMessage: 'Click to add a note' },
 });
 
-class InlineAlert extends React.PureComponent {
+class InlineAlert extends PureComponent {
 
   static propTypes = {
     show: PropTypes.bool,

+ 0 - 1
app/javascript/mastodon/features/account/components/featured_tags.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import PropTypes from 'prop-types';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import ImmutablePureComponent from 'react-immutable-pure-component';

+ 0 - 1
app/javascript/mastodon/features/account/components/follow_request_note.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import { FormattedMessage } from 'react-intl';
 import ImmutablePureComponent from 'react-immutable-pure-component';

+ 3 - 3
app/javascript/mastodon/features/account/components/header.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { Fragment } from 'react';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import PropTypes from 'prop-types';
 import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
@@ -399,10 +399,10 @@ class Header extends ImmutablePureComponent {
             {!suspended && (
               <div className='account__header__tabs__buttons'>
                 {!hidden && (
-                  <React.Fragment>
+                  <Fragment>
                     {actionBtn}
                     {bellBtn}
-                  </React.Fragment>
+                  </Fragment>
                 )}
 
                 <DropdownMenuContainer disabled={menu.length === 0} items={menu} icon='ellipsis-v' size={24} direction='right' />

+ 2 - 2
app/javascript/mastodon/features/account/navigation.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import { connect } from 'react-redux';
 import FeaturedTags from 'mastodon/features/account/containers/featured_tags_container';
@@ -19,7 +19,7 @@ const mapStateToProps = (state, { match: { params: { acct } } }) => {
   };
 };
 
-class AccountNavigation extends React.PureComponent {
+class AccountNavigation extends PureComponent {
 
   static propTypes = {
     match: PropTypes.shape({

+ 0 - 1
app/javascript/mastodon/features/account_gallery/components/media_item.jsx

@@ -3,7 +3,6 @@ import classNames from 'classnames';
 import { Icon }  from 'mastodon/components/icon';
 import { autoPlayGif, displayMedia, useBlurhash } from 'mastodon/initial_state';
 import PropTypes from 'prop-types';
-import React from 'react';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import ImmutablePureComponent from 'react-immutable-pure-component';
 

+ 0 - 1
app/javascript/mastodon/features/account_gallery/index.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import { connect } from 'react-redux';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import PropTypes from 'prop-types';

+ 0 - 1
app/javascript/mastodon/features/account_timeline/components/header.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import PropTypes from 'prop-types';
 import InnerHeader from '../../account/components/header';

+ 2 - 2
app/javascript/mastodon/features/account_timeline/components/limited_account_hint.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import { connect } from 'react-redux';
 import { revealAccount } from 'mastodon/actions/accounts';
@@ -14,7 +14,7 @@ const mapDispatchToProps = (dispatch, { accountId }) => ({
 
 });
 
-class LimitedAccountHint extends React.PureComponent {
+class LimitedAccountHint extends PureComponent {
 
   static propTypes = {
     accountId: PropTypes.string.isRequired,

+ 0 - 1
app/javascript/mastodon/features/account_timeline/components/memorial_note.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import { FormattedMessage } from 'react-intl';
 
 const MemorialNote = () => (

+ 0 - 1
app/javascript/mastodon/features/account_timeline/components/moved_note.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import { FormattedMessage } from 'react-intl';
 import ImmutablePureComponent from 'react-immutable-pure-component';

+ 0 - 1
app/javascript/mastodon/features/account_timeline/containers/header_container.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import { connect } from 'react-redux';
 import { makeGetAccount, getAccountHidden } from '../../../selectors';
 import Header from '../components/header';

+ 0 - 1
app/javascript/mastodon/features/account_timeline/index.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import { connect } from 'react-redux';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import PropTypes from 'prop-types';

+ 2 - 2
app/javascript/mastodon/features/audio/index.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
 import { formatTime, getPointerPosition, fileNameFromURL } from 'mastodon/features/video';
@@ -22,7 +22,7 @@ const messages = defineMessages({
 const TICK_SIZE = 10;
 const PADDING   = 180;
 
-class Audio extends React.PureComponent {
+class Audio extends PureComponent {
 
   static propTypes = {
     src: PropTypes.string.isRequired,

+ 0 - 1
app/javascript/mastodon/features/blocks/index.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import { connect } from 'react-redux';
 import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
 import ImmutablePureComponent from 'react-immutable-pure-component';

+ 0 - 1
app/javascript/mastodon/features/bookmarked_statuses/index.jsx

@@ -1,6 +1,5 @@
 import { debounce } from 'lodash';
 import PropTypes from 'prop-types';
-import React from 'react';
 import { Helmet } from 'react-helmet';
 import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
 import ImmutablePropTypes from 'react-immutable-proptypes';

+ 0 - 1
app/javascript/mastodon/features/closed_registrations_modal/index.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import { connect } from 'react-redux';
 import { FormattedMessage } from 'react-intl';
 import ImmutablePureComponent from 'react-immutable-pure-component';

+ 2 - 2
app/javascript/mastodon/features/community_timeline/components/column_settings.jsx

@@ -1,10 +1,10 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import { injectIntl, FormattedMessage } from 'react-intl';
 import SettingToggle from '../../notifications/components/setting_toggle';
 
-class ColumnSettings extends React.PureComponent {
+class ColumnSettings extends PureComponent {
 
   static propTypes = {
     settings: ImmutablePropTypes.map.isRequired,

+ 2 - 2
app/javascript/mastodon/features/community_timeline/index.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import { connect } from 'react-redux';
 import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
 import PropTypes from 'prop-types';
@@ -30,7 +30,7 @@ const mapStateToProps = (state, { columnId }) => {
   };
 };
 
-class CommunityTimeline extends React.PureComponent {
+class CommunityTimeline extends PureComponent {
 
   static contextTypes = {
     router: PropTypes.object,

+ 2 - 2
app/javascript/mastodon/features/compose/components/action_bar.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import PropTypes from 'prop-types';
 import DropdownMenuContainer from '../../../containers/dropdown_menu_container';
@@ -20,7 +20,7 @@ const messages = defineMessages({
   bookmarks: { id: 'navigation_bar.bookmarks', defaultMessage: 'Bookmarks' },
 });
 
-class ActionBar extends React.PureComponent {
+class ActionBar extends PureComponent {
 
   static propTypes = {
     account: ImmutablePropTypes.map.isRequired,

+ 0 - 1
app/javascript/mastodon/features/compose/components/autosuggest_account.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import { Avatar } from '../../../components/avatar';
 import { DisplayName } from '../../../components/display_name';
 import ImmutablePropTypes from 'react-immutable-proptypes';

+ 2 - 2
app/javascript/mastodon/features/compose/components/character_counter.jsx

@@ -1,8 +1,8 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import { length } from 'stringz';
 
-export default class CharacterCounter extends React.PureComponent {
+export default class CharacterCounter extends PureComponent {
 
   static propTypes = {
     text: PropTypes.string.isRequired,

+ 0 - 1
app/javascript/mastodon/features/compose/components/compose_form.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import CharacterCounter from './character_counter';
 import Button from '../../../components/button';
 import ImmutablePropTypes from 'react-immutable-proptypes';

+ 5 - 5
app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
 import { EmojiPicker as EmojiPickerAsync } from '../../ui/util/async-components';
@@ -47,7 +47,7 @@ const notFoundFn = () => (
   </div>
 );
 
-class ModifierPickerMenu extends React.PureComponent {
+class ModifierPickerMenu extends PureComponent {
 
   static propTypes = {
     active: PropTypes.bool,
@@ -108,7 +108,7 @@ class ModifierPickerMenu extends React.PureComponent {
 
 }
 
-class ModifierPicker extends React.PureComponent {
+class ModifierPicker extends PureComponent {
 
   static propTypes = {
     active: PropTypes.bool,
@@ -144,7 +144,7 @@ class ModifierPicker extends React.PureComponent {
 
 }
 
-class EmojiPickerMenuImpl extends React.PureComponent {
+class EmojiPickerMenuImpl extends PureComponent {
 
   static propTypes = {
     custom_emojis: ImmutablePropTypes.list,
@@ -306,7 +306,7 @@ class EmojiPickerMenuImpl extends React.PureComponent {
 
 const EmojiPickerMenu = injectIntl(EmojiPickerMenuImpl);
 
-class EmojiPickerDropdown extends React.PureComponent {
+class EmojiPickerDropdown extends PureComponent {
 
   static propTypes = {
     custom_emojis: ImmutablePropTypes.list,

+ 3 - 3
app/javascript/mastodon/features/compose/components/language_dropdown.jsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import { injectIntl, defineMessages } from 'react-intl';
 import TextIconButton from './text_icon_button';
@@ -17,7 +17,7 @@ const messages = defineMessages({
 
 const listenerOptions = supportsPassiveEvents ? { passive: true, capture: true } : true;
 
-class LanguageDropdownMenu extends React.PureComponent {
+class LanguageDropdownMenu extends PureComponent {
 
   static propTypes = {
     value: PropTypes.string.isRequired,
@@ -238,7 +238,7 @@ class LanguageDropdownMenu extends React.PureComponent {
 
 }
 
-class LanguageDropdown extends React.PureComponent {
+class LanguageDropdown extends PureComponent {
 
   static propTypes = {
     value: PropTypes.string,

Some files were not shown because too many files changed in this diff