소스 검색

react: remove custom Fragment

Fragment now works on both React and React Native, so use it.
master
Saúl Ibarra Corretgé 7 년 전
부모
커밋
9ac5aafe10

+ 3
- 3
react/features/app/components/AbstractApp.js 파일 보기

@@ -1,7 +1,7 @@
1 1
 /* global APP */
2 2
 
3 3
 import PropTypes from 'prop-types';
4
-import React, { Component } from 'react';
4
+import React, { Component, Fragment } from 'react';
5 5
 import { I18nextProvider } from 'react-i18next';
6 6
 import { Provider } from 'react-redux';
7 7
 import { compose, createStore } from 'redux';
@@ -9,7 +9,7 @@ import Thunk from 'redux-thunk';
9 9
 
10 10
 import { i18next } from '../../base/i18n';
11 11
 import { localParticipantLeft } from '../../base/participants';
12
-import { Fragment, RouteRegistry } from '../../base/react';
12
+import { RouteRegistry } from '../../base/react';
13 13
 import {
14 14
     MiddlewareRegistry,
15 15
     ReducerRegistry,
@@ -131,7 +131,7 @@ export class AbstractApp extends Component {
131 131
 
132 132
             dispatch(appWillMount(this));
133 133
 
134
-            // We set the initialized state here and not in the contructor to
134
+            // We set the initialized state here and not in the constructor to
135 135
             // make sure that {@code componentWillMount} gets invoked before
136 136
             // the app tries to render the actual app content.
137 137
             this.setState({

+ 0
- 30
react/features/base/react/components/Fragment.js 파일 보기

@@ -1,30 +0,0 @@
1
-// @flow
2
-
3
-import { Component } from 'react';
4
-
5
-/**
6
- * {@code Fragment} component's property types.
7
- *
8
- * @static
9
- */
10
-type Props = {
11
-    children: React$Node
12
-};
13
-
14
-/**
15
- * react-redux's {@code Provider} component only accepts a single child, so use
16
- * a simple wrapper component in order to pass more than 1 child components.
17
- *
18
- * TODO Remove once React Native supports Fragment (0.52 probably).
19
- */
20
-export default class Fragment extends Component<Props> {
21
-    /**
22
-     * Implements React's {@link Component#render()}.
23
-     *
24
-     * @inheritdoc
25
-     * @returns {React$Node}
26
-     */
27
-    render() {
28
-        return this.props.children;
29
-    }
30
-}

+ 0
- 1
react/features/base/react/components/index.js 파일 보기

@@ -1,2 +1 @@
1 1
 export * from './_';
2
-export { default as Fragment } from './Fragment';

+ 1
- 8
react/features/base/sounds/components/SoundCollection.js 파일 보기

@@ -5,7 +5,6 @@ import { connect } from 'react-redux';
5 5
 
6 6
 import { Audio } from '../../media';
7 7
 import type { AudioElement } from '../../media';
8
-import { Fragment } from '../../react';
9 8
 
10 9
 import { _addAudioElement, _removeAudioElement } from '../actions';
11 10
 import type { Sound } from '../reducer';
@@ -68,13 +67,7 @@ class SoundCollection extends Component<Props> {
68 67
             key += 1;
69 68
         }
70 69
 
71
-        return (
72
-            <Fragment>
73
-                {
74
-                    sounds
75
-                }
76
-            </Fragment>
77
-        );
70
+        return sounds;
78 71
     }
79 72
 
80 73
     /**

+ 1
- 3
react/features/base/testing/components/TestConnectionInfo.js 파일 보기

@@ -1,10 +1,8 @@
1 1
 // @flow
2 2
 
3
-import React, { Component } from 'react';
3
+import React, { Component, Fragment } from 'react';
4 4
 import { connect } from 'react-redux';
5 5
 
6
-
7
-import { Fragment } from '../../react';
8 6
 import { getLocalParticipant } from '../../participants';
9 7
 
10 8
 // FIXME this imports feature to 'base'

+ 3
- 5
react/features/base/toolbox/components/ToolboxItem.web.js 파일 보기

@@ -1,7 +1,7 @@
1 1
 // @flow
2 2
 
3 3
 import Tooltip from '@atlaskit/tooltip';
4
-import React from 'react';
4
+import React, { Fragment } from 'react';
5 5
 
6 6
 import AbstractToolboxItem from './AbstractToolboxItem';
7 7
 import type { Props } from './AbstractToolboxItem';
@@ -33,12 +33,10 @@ export default class ToolboxItem extends AbstractToolboxItem<Props> {
33 33
         const elementType = showLabel ? 'li' : 'div';
34 34
         // eslint-disable-next-line no-extra-parens
35 35
         const children = (
36
-
37
-            // $FlowFixMe
38
-            <React.Fragment>
36
+            <Fragment>
39 37
                 { this._renderIcon() }
40 38
                 { showLabel && this.label }
41
-            </React.Fragment>
39
+            </Fragment>
42 40
         );
43 41
 
44 42
         return React.createElement(elementType, props, children);

Loading…
취소
저장