Web Security · Senior · Question 16 of 75

In a design system, a <RichText html={...} /> component wraps dangerouslySetInnerHTML. What's the most robust approach?

Explanation

Putting the safety check at the single sink makes the safe path the default. Types and lint rules can block direct dangerouslySetInnerHTML elsewhere.

Further reading

Problem with a question

Web Security · Senior · question 16

Test yourself

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

Take this quiz