![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
vision-camera-dynamsoft-label-recognizer
Advanced tools
React Native Vision Camera Frame Processor Plugin of Dynamsoft Label Recognizer
React Native Vision Camera Frame Processor Plugin of Dynamsoft Label Recognizer
npm install vision-camera-dynamsoft-label-recognizer
make sure you correctly setup react-native-reanimated and add this to your babel.config.js
[
'react-native-reanimated/plugin',
{
globals: ['__recognize'],
},
]
-keep class androidx.camera.core.** {*;}
Live scanning using React Native Vision Camera.
import * as React from 'react';
import { StyleSheet } from 'react-native';
import { Camera, useCameraDevices, useFrameProcessor } from 'react-native-vision-camera';
import { recognize, ScanConfig } from 'vision-camera-dynamsoft-label-recognizer';
import * as DLR from 'vision-camera-dynamsoft-label-recognizer';
import * as REA from 'react-native-reanimated';
export default function App() {
const [hasPermission, setHasPermission] = React.useState(false);
const devices = useCameraDevices();
const device = devices.back;
React.useEffect(() => {
(async () => {
const status = await Camera.requestCameraPermission();
setHasPermission(status === 'authorized');
const result = await DLR.initLicense("<license>"); //apply for a 30-day trial license here: https://www.dynamsoft.com/customer/license/trialLicense/?product=dlr
if (result === false) {
Alert.alert("Error","License invalid");
}
})();
}, []);
const frameProcessor = useFrameProcessor((frame) => {
'worklet'
const config:ScanConfig = {};
const result = recognize(frame,config);
}, [])
return (
device != null &&
hasPermission && (
<>
<Camera
style={StyleSheet.absoluteFill}
device={device}
isActive={true}
frameProcessor={frameProcessor}
frameProcessorFps={1}
/>
</>
)
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
});
Recognizing text from static images.
import * as DLR from "vision-camera-dynamsoft-label-recognizer";
const result = await DLR.decodeBase64(base64);
Scanning configuration:
//the value is in percentage
export interface ScanRegion{
left: number;
top: number;
width: number;
height: number;
}
export interface ScanConfig{
scanRegion?: ScanRegion;
includeImageBase64?: boolean;
}
export interface CustomModelConfig {
customModelFolder: string;
customModelFileNames: string[];
}
You can use a custom model like a model for MRZ passport reading using the CustomModelConfig
prop and update the template. You can find the MRZ model and template in the example.
You need to put the model folder in the assets
folder for Android or the root for iOS.
About the result:
export interface ScanResult {
results: DLRResult[];
imageBase64?: string;
}
export interface DLRResult {
referenceRegionName: string;
textAreaName: string;
pageNumber: number;
location: Quadrilateral;
lineResults: DLRLineResult[];
}
export interface Quadrilateral{
points:Point[];
}
export interface Point {
x:number;
y:number;
}
export interface DLRLineResult {
text: string;
confidence: number;
characterModelName: string;
characterResults: DLRCharacherResult[];
lineSpecificationName: string;
location: Quadrilateral;
}
export interface DLRCharacherResult {
characterH: string;
characterM: string;
characterL: string;
characterHConfidence: number;
characterMConfidence: number;
characterLConfidence: number;
location: Quadrilateral;
}
Let's create a new react native project and use the plugin.
npx react-native init MyTestApp
npm install vision-camera-dynamsoft-label-recognizer react-native-reanimated react-native-vision-camera
. Update relevant files following the react-native-reanimated installation guide. You can use jsc instead of hermesbabel.config.js
fileApp.tsx
to use the camera and the pluginMainApplication.java
following the guidenpx react-native run-andoid/run-ios
You can check out the example for more details.
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library
FAQs
React Native Vision Camera Frame Processor Plugin of Dynamsoft Label Recognizer
The npm package vision-camera-dynamsoft-label-recognizer receives a total of 24 weekly downloads. As such, vision-camera-dynamsoft-label-recognizer popularity was classified as not popular.
We found that vision-camera-dynamsoft-label-recognizer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.