feat: fixes and formatter

This commit is contained in:
2026-01-12 16:01:32 +01:00
parent 85c6084351
commit 11e632acff
353 changed files with 23315 additions and 27361 deletions
+2 -2
View File
@@ -1,3 +1,3 @@
import { WebView as NativeWebView } from "react-native-webview";
import { WebView as NativeWebView } from 'react-native-webview'
export const WebView = NativeWebView;
export const WebView = NativeWebView
+17 -17
View File
@@ -1,39 +1,39 @@
import React, { useEffect, useRef } from "react";
import React, { useEffect, useRef } from 'react'
export const WebView = ({ source, allowFullScreen, onURLChange }) => {
const iframeRef = useRef(null);
const iframeRef = useRef(null)
useEffect(() => {
// Définition de la fonction handleLoad à l'intérieur du useEffect
const handleLoad = () => {
try {
const currentUrl = iframeRef.current?.contentWindow?.location?.href;
onURLChange(currentUrl); // Appeler la fonction de callback avec l'URL actuelle
const currentUrl = iframeRef.current?.contentWindow?.location?.href
onURLChange(currentUrl) // Appeler la fonction de callback avec l'URL actuelle
} catch (error) {
console.error("Erreur d'accès à l'URL de l'iframe:", error);
console.error("Erreur d'accès à l'URL de l'iframe:", error)
}
};
}
const iframeElement = iframeRef.current;
iframeElement.addEventListener("load", handleLoad);
const iframeElement = iframeRef.current
iframeElement.addEventListener('load', handleLoad)
return () => {
iframeElement.removeEventListener("load", handleLoad);
};
}, [onURLChange]); // Assurez-vous que cette dépendance est correctement définie pour éviter des appels excessifs
iframeElement.removeEventListener('load', handleLoad)
}
}, [onURLChange]) // Assurez-vous que cette dépendance est correctement définie pour éviter des appels excessifs
return (
<iframe
ref={iframeRef}
src={source?.uri}
style={{
display: "flex",
border: "none",
width: "100%",
height: "100vh",
display: 'flex',
border: 'none',
width: '100%',
height: '100vh',
}}
title="minuit.starter"
allowFullScreen={allowFullScreen}
/>
);
};
)
}