Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update React imports #629

Merged
merged 1 commit into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/reactnavigation/src/AppNavigator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'react-native-gesture-handler';
import React from 'react';
import * as React from 'react';
import { createStackNavigator } from '@react-navigation/stack';

import HomeScreen from './screens/HomeScreen';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { render, fireEvent } from '@testing-library/react-native';

Expand Down
2 changes: 1 addition & 1 deletion examples/reactnavigation/src/screens/DetailsScreen.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { Text, StyleSheet, View } from 'react-native';

export default function DetailsScreen(props) {
Expand Down
2 changes: 1 addition & 1 deletion examples/reactnavigation/src/screens/HomeScreen.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import {
Text,
View,
Expand Down
2 changes: 1 addition & 1 deletion examples/redux/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { StyleSheet, View, StatusBar } from 'react-native';
import { Provider } from 'react-redux';
import configureStore from './store';
Expand Down
2 changes: 1 addition & 1 deletion examples/redux/components/AddTodo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { Button, StyleSheet, Text, View, TextInput } from 'react-native';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
Expand Down
2 changes: 1 addition & 1 deletion examples/redux/components/AddTodo.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { Provider } from 'react-redux';
import { fireEvent, render } from '@testing-library/react-native';
import configureStore from '../store';
Expand Down
2 changes: 1 addition & 1 deletion examples/redux/components/TodoElem.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { StyleSheet, Button, Text, View } from 'react-native';

export default function TodoElem({ todo, onDelete }) {
Expand Down
2 changes: 1 addition & 1 deletion examples/redux/components/TodoList.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { FlatList, Text } from 'react-native';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
Expand Down
2 changes: 1 addition & 1 deletion examples/redux/components/TodoList.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { Provider } from 'react-redux';
import { fireEvent, render } from '@testing-library/react-native';
import configureStore from '../store';
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/a11yAPI.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import React from 'react';
import * as React from 'react';
import { TouchableOpacity, Text } from 'react-native';
import { render } from '..';

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/act.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import React from 'react';
import * as React from 'react';
import { Text } from 'react-native';
import ReactTestRenderer from 'react-test-renderer';
import act from '../act';
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/auto-cleanup-skip.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import React from 'react';
import * as React from 'react';
import { View } from 'react-native';

let render;
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/auto-cleanup.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import React from 'react';
import * as React from 'react';
import { View } from 'react-native';
import { render } from '..';

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/cleanup.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @flow
/* eslint-disable react/no-multi-comp */
import React from 'react';
import * as React from 'react';
import { View } from 'react-native';
import { cleanup, render } from '../pure';

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/findByApi.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import React from 'react';
import * as React from 'react';
import { View, Text, TextInput } from 'react-native';
import { render } from '..';

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/fireEvent.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import React from 'react';
import * as React from 'react';
import {
View,
TouchableOpacity,
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/getByApi.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import React from 'react';
import * as React from 'react';
import { View, Text, TextInput, Button } from 'react-native';
import { render } from '..';

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/jest-native.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import React from 'react';
import * as React from 'react';
import { StyleSheet, View, Button, Text, TextInput } from 'react-native';
import { render } from '..';
import '@testing-library/jest-native/extend-expect';
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/queryByApi.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import React from 'react';
import * as React from 'react';
import { Text, Image } from 'react-native';
import { render } from '..';

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/questionsBoard.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import React from 'react';
import * as React from 'react';
import {
View,
TouchableOpacity,
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/render.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import React from 'react';
import * as React from 'react';
import {
View,
Text,
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/waitFor.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import React from 'react';
import * as React from 'react';
import { View, Text, TouchableOpacity } from 'react-native';
import { render, fireEvent, waitFor } from '..';

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/within.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import React from 'react';
import * as React from 'react';
import { View, Text, TextInput } from 'react-native';
import { render, within, getQueriesForElement } from '..';

Expand Down
8 changes: 4 additions & 4 deletions website/docs/ReactNavigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Create an [`./AppNavigator.js`](https://github.com/callstack/react-native-testin

```jsx
import 'react-native-gesture-handler';
import React from 'react';
import * as React from 'react';
import { createStackNavigator } from '@react-navigation/stack';

import HomeScreen from './screens/HomeScreen';
Expand All @@ -40,7 +40,7 @@ export default function Navigation() {
Create your two screens which we will transition to and from them. The homescreen, found in [`./screens/HomeScreen.js`](https://github.com/callstack/react-native-testing-library/blob/master/examples/reactnavigation/src/screens/HomeScreen.js), contains a list of elements presented in a list view. On tap of any of these items will move to the details screen with the item number:

```jsx
import React from 'react';
import * as React from 'react';
import {
Text,
View,
Expand Down Expand Up @@ -96,7 +96,7 @@ The details screen, found in [`./screens/DetailsScreen.js`](https://github.com/c

```jsx
// ./screens/DetailsScreen.js
import React from 'react';
import * as React from 'react';
import { Text, StyleSheet, View } from 'react-native';

export default function DetailsScreen(props) {
Expand Down Expand Up @@ -152,7 +152,7 @@ For this example, we are going to test out two things. The first thing is that t
Let's add a [`AppNavigator.test.js`](https://github.com/callstack/react-native-testing-library/blob/master/examples/reactnavigation/src/__tests__/AppNavigator.js) file in `src/__tests__` directory:

```jsx
import React from 'react';
import * as React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { render, fireEvent } from '@testing-library/react-native';

Expand Down
4 changes: 2 additions & 2 deletions website/docs/ReduxIntegration.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Our test is on the components that either dispatch actions on the redux store or
For `./components/AddTodo.test.js`

```jsx
import React from 'react';
import * as React from 'react';
import { Provider } from 'react-redux';
import { cleanup, fireEvent, render } from '@testing-library/react-native';
import configureStore from '../store';
Expand Down Expand Up @@ -63,7 +63,7 @@ describe('AddTodo component test', () => {
For the `./components/TodoList.js`

```jsx
import React from 'react';
import * as React from 'react';
import { Provider } from 'react-redux';
import { fireEvent, render } from '@testing-library/react-native';
import configureStore from '../store';
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/Feature.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import classnames from 'classnames';
import PropTypes from 'prop-types';
import useBaseUrl from '@docusaurus/useBaseUrl';
Expand Down
2 changes: 1 addition & 1 deletion website/src/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import classnames from 'classnames';
import Layout from '@theme/Layout';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
Expand Down