Web Security · Junior · Question 22 of 75

What risk does dangerouslySetInnerHTML bring in React?

Explanation

The long name is a warning. If the HTML comes from users or third parties, sanitize it first, for example with DOMPurify.

Further reading

Problem with a question

Web Security · Junior · question 22

Test yourself

Take the Web Security · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz