Removed unused imports and const declarations (#5053)

This commit is contained in:
Badr Rahal
2018-10-01 21:12:36 +02:00
parent e979e3e688
commit abe07200e6
15 changed files with 6 additions and 30 deletions

View File

@@ -1,5 +1,5 @@
import React from 'react';
import { StyleSheet, View } from 'react-native';
import { View } from 'react-native';
import renderer from 'react-test-renderer';

View File

@@ -1,4 +1,4 @@
import React, { Component } from 'react';
import React from 'react';
import { View } from 'react-native';
import renderer from 'react-test-renderer';

View File

@@ -1,5 +1,4 @@
import React, { Component } from 'react';
import { View } from 'react-native';
import renderer from 'react-test-renderer';
const {

View File

@@ -1,8 +1,6 @@
import React from 'react';
import { polyfill } from 'react-lifecycles-compat';
import getChildEventSubscriber from '../getChildEventSubscriber';
function createNavigator(NavigatorView, router, navigationConfig) {
class Navigator extends React.Component {
static router = router;
@@ -16,7 +14,7 @@ function createNavigator(NavigatorView, router, navigationConfig) {
static getDerivedStateFromProps(nextProps, prevState) {
const prevDescriptors = prevState.descriptors;
const { navigation, screenProps } = nextProps;
const { dispatch, state, addListener } = navigation;
const { state } = navigation;
const { routes } = state;
if (typeof routes === 'undefined') {
throw new TypeError(

View File

@@ -1,4 +1,3 @@
import React from 'react';
import createNavigator from '../navigators/createNavigator';
import SwitchRouter from '../routers/SwitchRouter';
import SwitchView from '../views/SwitchView/SwitchView';

View File

@@ -4,9 +4,7 @@ import React from 'react';
import SwitchRouter from '../SwitchRouter';
import StackRouter from '../StackRouter';
import StackActions from '../StackActions';
import NavigationActions from '../../NavigationActions';
import { urlToPathAndParams } from '../pathUtils';
import { _TESTING_ONLY_normalize_keys } from '../KeyGenerator';
beforeEach(() => {
@@ -442,16 +440,6 @@ const performRouterTest = createTestRouter => {
});
test('URI encoded path param gets parsed and correctly printed', () => {
const router = createTestRouter({
main: {
screen: () => <div />,
},
person: {
path: 'people/:name',
screen: () => <div />,
},
});
const action = testRouter.getActionForPathAndParams('people/Henry%20L');
expect(action).toEqual({
routeName: 'person',

View File

@@ -492,7 +492,7 @@ describe('StackRouter', () => {
},
state
);
const barKey = state2.routes[1].routes[0].key;
const state3 = router.getStateForAction(
{
type: StackActions.POP_TO_TOP,
@@ -520,7 +520,7 @@ describe('StackRouter', () => {
},
state
);
const barKey = state2.routes[1].routes[0].key;
const state3 = router.getStateForAction(
{
type: StackActions.POP_TO_TOP,

View File

@@ -3,7 +3,6 @@
import React from 'react';
import TabRouter from '../TabRouter';
import StackActions from '../../routers/StackActions';
import NavigationActions from '../../NavigationActions';
const INIT_ACTION = { type: NavigationActions.INIT };

View File

@@ -26,7 +26,7 @@ export default (routeConfigs, navigatorScreenConfig) => (
navigation,
screenProps
) => {
const { state, dispatch } = navigation;
const { state } = navigation;
const route = state;
invariant(

View File

@@ -1,5 +1,3 @@
import { Animated } from 'react-native';
export default class AnimatedValueSubscription {
constructor(value, callback) {
this._value = value;

View File

@@ -1,4 +1,3 @@
import React from 'react';
import createReactContext from 'create-react-context';
const NavigationContext = createReactContext();

View File

@@ -1,6 +1,5 @@
import React from 'react';
import { Platform, StyleSheet, View } from 'react-native';
import PropTypes from 'prop-types';
import { polyfill } from 'react-lifecycles-compat';
import SceneView from './SceneView';

View File

@@ -1,5 +1,4 @@
import React from 'react';
import { View } from 'react-native';
import renderer from 'react-test-renderer';
import NavigationEvents from '../NavigationEvents';
import { NavigationProvider } from '../NavigationContext';

View File

@@ -1,5 +1,4 @@
import React from 'react';
import propTypes from 'prop-types';
import hoistStatics from 'hoist-non-react-statics';
import invariant from '../utils/invariant';
import { NavigationConsumer } from './NavigationContext';

View File

@@ -1,5 +1,4 @@
import React from 'react';
import propTypes from 'prop-types';
import hoistStatics from 'hoist-non-react-statics';
import invariant from '../utils/invariant';
import withNavigation from './withNavigation';