How to use dangerouslySetInnerHTML in a safer way in NextJs?
Unanswered
West African Lion posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
West African LionOP
I used dangerouslySetInnerHTML in page.tsx , it rendered the page the way I want it to but it gave Hydration error in the console. So, I used a package called "html-react-parser", Now the errors are gone but my team lead is saying that it is still exposing the app to XSS attacks. How can I rectify this? PFA for how I am using the html-react-parser. Here Parser is : import Parser from 'react-html-parser';
![Image](https://cdn.discordapp.com/attachments/1196737768848629831/1196737768995422268/image.png?ex=65b8b7e6&is=65a642e6&hm=6be443fa4355bd45ab15c2af4ef3cb5561c8cdb96af6cfcb8dd4905e8210eb9a&)