Browser & Web Performance · Junior · Question 61 of 75

Why don't React and Vue templates usually cause XSS when you render {userInput}?

Explanation

Escaping is the default; risk returns with escape hatches like dangerouslySetInnerHTML or v-html, and with javascript: URLs.

Further reading

Problem with a question

Browser & Web Performance · Junior · question 61

Test yourself

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

Take this quiz