Skip to content
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
6 changes: 3 additions & 3 deletions next/camera-snapshot/src/components/camera-snapshot.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Head from 'next/head';
import { useEffect, useRef, useState, CSSProperties } from 'react';
import { useLayoutEffect, useRef, useState, CSSProperties } from 'react';
import {
EventActions,
defineComponents,
Expand Down Expand Up @@ -46,7 +46,7 @@ export default function CameraSnapshot() {
}
};

useEffect(() => {
useLayoutEffect(() => {
const containerCurrent = containerRef.current;

void defineComponents();
Expand All @@ -60,7 +60,7 @@ export default function CameraSnapshot() {
}
}, []);

useEffect(() => {
useLayoutEffect(() => {
const elementRefCurrent = elementRef.current;

if (!elementRefCurrent) return;
Expand Down
6 changes: 3 additions & 3 deletions next/document-reader/src/components/document-reader.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Head from 'next/head';
import { useEffect, useRef, useState, CSSProperties } from 'react';
import { useLayoutEffect, useRef, useState, CSSProperties } from 'react';
import {
EventActions,
DocumentReaderDetailType,
Expand Down Expand Up @@ -49,7 +49,7 @@ export default function DocumentReader() {
}
};

useEffect(() => {
useLayoutEffect(() => {
const containerCurrent = containerRef.current;

window.RegulaDocumentSDK = new DocumentReaderService();
Expand Down Expand Up @@ -80,7 +80,7 @@ export default function DocumentReader() {
}
}, []);

useEffect(() => {
useLayoutEffect(() => {
const elementRefCurrent = elementRef.current;

if (!elementRefCurrent) return;
Expand Down
6 changes: 3 additions & 3 deletions react-ts/camera-snapshot/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CSSProperties, useEffect, useRef, useState } from 'react';
import { CSSProperties, useLayoutEffect, useRef, useState } from 'react';
import {
EventActions,
defineComponents,
Expand Down Expand Up @@ -45,7 +45,7 @@ function App() {
}
};

useEffect(() => {
useLayoutEffect(() => {
const containerCurrent = containerRef.current;

void defineComponents();
Expand All @@ -59,7 +59,7 @@ function App() {
}
}, []);

useEffect(() => {
useLayoutEffect(() => {
const elementRefCurrent = elementRef.current;

if (!elementRefCurrent) return;
Expand Down
6 changes: 3 additions & 3 deletions react-ts/document-reader-device/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState, useRef, useEffect, CSSProperties } from 'react';
import { useState, useRef, useLayoutEffect, CSSProperties } from 'react';
import {
EventActions,
defineComponents,
Expand Down Expand Up @@ -32,7 +32,7 @@ function App() {
const containerRef = useRef<HTMLDivElement>(null);
const elementRef = useRef<DocumentReaderDeviceWebComponent>(null);

useEffect(() => {
useLayoutEffect(() => {
const containerCurrent = containerRef.current;
const listener = (data: CustomEvent<DocumentReaderDetailType>) => {
if (data.detail.action === EventActions.PROCESS_FINISHED) {
Expand All @@ -59,7 +59,7 @@ function App() {
}
}, []);

useEffect(() => {
useLayoutEffect(() => {
const elementRefCurrent = elementRef.current;

if (!elementRefCurrent) return;
Expand Down
6 changes: 3 additions & 3 deletions react-ts/document-reader/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CSSProperties, useEffect, useRef, useState } from 'react';
import { CSSProperties, useLayoutEffect, useRef, useState } from 'react';
import {
defineComponents,
DocumentReaderService,
Expand Down Expand Up @@ -48,7 +48,7 @@ function App() {
}
};

useEffect(() => {
useLayoutEffect(() => {
const containerCurrent = containerRef.current;

window.RegulaDocumentSDK = new DocumentReaderService();
Expand Down Expand Up @@ -78,7 +78,7 @@ function App() {
}
}, []);

useEffect(() => {
useLayoutEffect(() => {
const elementRefCurrent = elementRef.current;

if (!elementRefCurrent) return;
Expand Down