Closed JeremyBradshaw7 closed 1 year ago
To be frank, no idea - sorry :smiling_face_with_tear:
Most use-cases should be solvable using the documentation here: https://github.com/cure53/DOMPurify#using-the-minified-and-tested-production-version-source-map-available
Everything else we don't really know and would have to investigate ourselves.
Closing as I dont think it is possible.
I want to sanitise html that is user-input before I render it in a react-native-webview. However, I'm getting this error :
TypeError: _dompurify.default.sanitize is not a function
in the console. I've added both the latest
dompurify
and@types/dompurify
packages, and imported thus:import DOMPurify from 'dompurify';
I'm calling the sanitize function outside the webview in the React Native realm, to sanitize the content before passing that content to the webview.
One issue may be that I don't have a DOM engine. I tried the Node approach (meant for servers) but unfortunately installing
jsdom
as well completely broke the compilation, so instead I plan to usejsdom-jscore-rn
.This is shown i the console if I log the package:
So it is importing it as it's finding the version, but is instantiated as not supported.