diff --git a/examples/reactnavigation/src/AppNavigator.js b/examples/reactnavigation/src/AppNavigator.js index e0510ce60..3d6ae6135 100644 --- a/examples/reactnavigation/src/AppNavigator.js +++ b/examples/reactnavigation/src/AppNavigator.js @@ -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'; diff --git a/examples/reactnavigation/src/__tests__/AppNavigator.test.js b/examples/reactnavigation/src/__tests__/AppNavigator.test.js index e76ea4339..69cba3d15 100644 --- a/examples/reactnavigation/src/__tests__/AppNavigator.test.js +++ b/examples/reactnavigation/src/__tests__/AppNavigator.test.js @@ -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'; diff --git a/examples/reactnavigation/src/screens/DetailsScreen.js b/examples/reactnavigation/src/screens/DetailsScreen.js index 0f7ed93b7..62635c8ed 100644 --- a/examples/reactnavigation/src/screens/DetailsScreen.js +++ b/examples/reactnavigation/src/screens/DetailsScreen.js @@ -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) { diff --git a/examples/reactnavigation/src/screens/HomeScreen.js b/examples/reactnavigation/src/screens/HomeScreen.js index ac1aa831e..67046c5ff 100644 --- a/examples/reactnavigation/src/screens/HomeScreen.js +++ b/examples/reactnavigation/src/screens/HomeScreen.js @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { Text, View, diff --git a/examples/redux/App.js b/examples/redux/App.js index 9712cdf2d..2b9499cd0 100644 --- a/examples/redux/App.js +++ b/examples/redux/App.js @@ -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'; diff --git a/examples/redux/components/AddTodo.js b/examples/redux/components/AddTodo.js index 7ab31fc89..b501c7392 100644 --- a/examples/redux/components/AddTodo.js +++ b/examples/redux/components/AddTodo.js @@ -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'; diff --git a/examples/redux/components/AddTodo.test.js b/examples/redux/components/AddTodo.test.js index 3e1155b44..7e3cdacfa 100644 --- a/examples/redux/components/AddTodo.test.js +++ b/examples/redux/components/AddTodo.test.js @@ -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'; diff --git a/examples/redux/components/TodoElem.js b/examples/redux/components/TodoElem.js index 8932c0471..0575c54e6 100644 --- a/examples/redux/components/TodoElem.js +++ b/examples/redux/components/TodoElem.js @@ -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 }) { diff --git a/examples/redux/components/TodoList.js b/examples/redux/components/TodoList.js index 3c66f73e3..3765e360d 100644 --- a/examples/redux/components/TodoList.js +++ b/examples/redux/components/TodoList.js @@ -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'; diff --git a/examples/redux/components/TodoList.test.js b/examples/redux/components/TodoList.test.js index a14d6af1f..a8418f46b 100644 --- a/examples/redux/components/TodoList.test.js +++ b/examples/redux/components/TodoList.test.js @@ -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'; diff --git a/src/__tests__/a11yAPI.test.js b/src/__tests__/a11yAPI.test.js index 0964cc98d..7e348bdd0 100644 --- a/src/__tests__/a11yAPI.test.js +++ b/src/__tests__/a11yAPI.test.js @@ -1,5 +1,5 @@ // @flow -import React from 'react'; +import * as React from 'react'; import { TouchableOpacity, Text } from 'react-native'; import { render } from '..'; diff --git a/src/__tests__/act.test.js b/src/__tests__/act.test.js index 2d3bb4909..0b536ab2a 100644 --- a/src/__tests__/act.test.js +++ b/src/__tests__/act.test.js @@ -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'; diff --git a/src/__tests__/auto-cleanup-skip.test.js b/src/__tests__/auto-cleanup-skip.test.js index 05ec373a7..846255dca 100644 --- a/src/__tests__/auto-cleanup-skip.test.js +++ b/src/__tests__/auto-cleanup-skip.test.js @@ -1,5 +1,5 @@ // @flow -import React from 'react'; +import * as React from 'react'; import { View } from 'react-native'; let render; diff --git a/src/__tests__/auto-cleanup.test.js b/src/__tests__/auto-cleanup.test.js index e33b4c3e1..5349dde9a 100644 --- a/src/__tests__/auto-cleanup.test.js +++ b/src/__tests__/auto-cleanup.test.js @@ -1,5 +1,5 @@ // @flow -import React from 'react'; +import * as React from 'react'; import { View } from 'react-native'; import { render } from '..'; diff --git a/src/__tests__/cleanup.test.js b/src/__tests__/cleanup.test.js index 1ccb752b6..7fdf2653b 100644 --- a/src/__tests__/cleanup.test.js +++ b/src/__tests__/cleanup.test.js @@ -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'; diff --git a/src/__tests__/findByApi.test.js b/src/__tests__/findByApi.test.js index f924cb1b3..25cdffed2 100644 --- a/src/__tests__/findByApi.test.js +++ b/src/__tests__/findByApi.test.js @@ -1,5 +1,5 @@ // @flow -import React from 'react'; +import * as React from 'react'; import { View, Text, TextInput } from 'react-native'; import { render } from '..'; diff --git a/src/__tests__/fireEvent.test.js b/src/__tests__/fireEvent.test.js index 0b5f72c27..a8f1ac43d 100644 --- a/src/__tests__/fireEvent.test.js +++ b/src/__tests__/fireEvent.test.js @@ -1,5 +1,5 @@ // @flow -import React from 'react'; +import * as React from 'react'; import { View, TouchableOpacity, diff --git a/src/__tests__/getByApi.test.js b/src/__tests__/getByApi.test.js index a2b2637d1..177af8b05 100644 --- a/src/__tests__/getByApi.test.js +++ b/src/__tests__/getByApi.test.js @@ -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 '..'; diff --git a/src/__tests__/jest-native.test.js b/src/__tests__/jest-native.test.js index c64226af3..f2f5e2b74 100644 --- a/src/__tests__/jest-native.test.js +++ b/src/__tests__/jest-native.test.js @@ -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'; diff --git a/src/__tests__/queryByApi.test.js b/src/__tests__/queryByApi.test.js index f7f39b991..82e89bf6e 100644 --- a/src/__tests__/queryByApi.test.js +++ b/src/__tests__/queryByApi.test.js @@ -1,5 +1,5 @@ // @flow -import React from 'react'; +import * as React from 'react'; import { Text, Image } from 'react-native'; import { render } from '..'; diff --git a/src/__tests__/questionsBoard.test.js b/src/__tests__/questionsBoard.test.js index 58ef4ae1f..b2c879400 100644 --- a/src/__tests__/questionsBoard.test.js +++ b/src/__tests__/questionsBoard.test.js @@ -1,5 +1,5 @@ // @flow -import React from 'react'; +import * as React from 'react'; import { View, TouchableOpacity, diff --git a/src/__tests__/render.test.js b/src/__tests__/render.test.js index a1d8d0c0d..760eac5e7 100644 --- a/src/__tests__/render.test.js +++ b/src/__tests__/render.test.js @@ -1,5 +1,5 @@ // @flow -import React from 'react'; +import * as React from 'react'; import { View, Text, diff --git a/src/__tests__/waitFor.test.js b/src/__tests__/waitFor.test.js index 84ee17266..78a05c310 100644 --- a/src/__tests__/waitFor.test.js +++ b/src/__tests__/waitFor.test.js @@ -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 '..'; diff --git a/src/__tests__/within.test.js b/src/__tests__/within.test.js index 29e4f3d57..386d4f9e3 100644 --- a/src/__tests__/within.test.js +++ b/src/__tests__/within.test.js @@ -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 '..'; diff --git a/website/docs/ReactNavigation.md b/website/docs/ReactNavigation.md index 3149d7a16..5d39c0062 100644 --- a/website/docs/ReactNavigation.md +++ b/website/docs/ReactNavigation.md @@ -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'; @@ -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, @@ -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) { @@ -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'; diff --git a/website/docs/ReduxIntegration.md b/website/docs/ReduxIntegration.md index 7cb6f7426..04875a346 100644 --- a/website/docs/ReduxIntegration.md +++ b/website/docs/ReduxIntegration.md @@ -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'; @@ -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'; diff --git a/website/src/components/Feature.js b/website/src/components/Feature.js index 838d6925e..abab4a3f0 100644 --- a/website/src/components/Feature.js +++ b/website/src/components/Feature.js @@ -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'; diff --git a/website/src/pages/index.js b/website/src/pages/index.js index 4a77cf7d2..547248183 100644 --- a/website/src/pages/index.js +++ b/website/src/pages/index.js @@ -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';