This repository has been archived by the owner on Jun 16, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(expo): explain how to migrate to and from expo camera module (#1605
- Loading branch information
Showing
2 changed files
with
33 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# [Expo](https://expo.io/) Usage | ||
|
||
RNCamera of react-native-camera is heavyly based on Expo camera module. Thanks @aalices and Expo for the great work. | ||
|
||
So you don't need to use **react-native-camera** if you have the following config: | ||
|
||
- If you are using [Expo](https://expo.io) | ||
- If you are using [create-react-native-app](https://github.com/react-community/create-react-native-app) | ||
- If you eject a [create-react-native-app](https://github.com/react-community/create-react-native-app) app and are using [ExpoKit](https://docs.expo.io/versions/latest/expokit/expokit) | ||
|
||
## How to migrate from Expo to react-native-camera | ||
|
||
If you decide to eject without using ExpoKit, you can follow react-native-camera installation instructions and just change the usage of your Camera component to RNCamera: | ||
|
||
```diff | ||
- import { Camera } from 'expo'; | ||
+ import { RNCamera } from 'react-native-camera'; | ||
|
||
- <Camera | ||
+ <RNCamera | ||
``` | ||
|
||
## How to migrate from react-native-camera to Expo Camera Module | ||
```diff | ||
- import { RNCamera } from 'react-native-camera'; | ||
+ import { Camera } from 'expo'; | ||
|
||
- <RNCamera | ||
+ <Camera | ||
``` | ||
|