Afaik, using dangerouslySetInnerHTML is the only way that XSS code could be injected into preact. I'm using dangerouslySetInnerHTML for some translations (from source code, not user-generated). One option is adding CI rules that ban dangerouslySetInnerHTML from the source code.