Conversation
Automatic merge into master to Release 3.16.0
Automatic merge into master to Release 3.16.1
Automatic merge into master to Release 3.16.2
Automatic merge into master to Release 3.16.3
Automatic merge into master to Release 3.16.4
Automatic merge into master to Release 3.17.0
Automatic merge into master to Release 3.17.1
Automatic merge into master to Release 3.17.2
Automatic merge into master to Release 3.17.3
Automatic merge into master to Release 3.18.0
Automatic merge into master to Release 3.18.1
Automatic merge into master to Release 3.18.2
Automatic merge into master to Release 3.18.3
Automatic merge into master to Release 3.18.4
Automatic merge into master to Release 3.18.5
| } | ||
| }; | ||
|
|
||
| const _onWebShareMessage = useCallback(async (param: WebShareAPIParam) => { |
There was a problem hiding this comment.
Porque non quero que se cree esta función en cada render. Todas as función se deberían de memoizar. Por exemplo handleRequestFromViewer estase recreando en cada render, e pasándoselle ao compoñente WebView como si fose unha prop nova siempre, e quizais non en todos os render é o caso.
Por ese mesmo motivo _androidShareInjection está dentro dun useMemo.
There was a problem hiding this comment.
Entón, é correcto manter const handleRequestFromViewer = (event: WebViewMessageEvent) => { sin engadir useCallback?
There was a problem hiding this comment.
No, non é correcto. Habería que revisar o plugin enteiro porque si lle meto useCallback a handleRequestFromViewer pero algunha das dependencias non ten useCallback é coma se non fixera nada 🤕 .
There was a problem hiding this comment.
Ok, xa te visitaremos xD
The Web Share API (
navigator.canShareandnavigator.share) is patched on Android WebView by overriding both methods in the Map Viewer, forwarding share events via postMessage, and handling them natively with the React Native Share API.