Improved some sections of the introducing JSX docs
Shubheksha Jalan committed
Nov 18, 2016 at 21:09 UTC
e4432c7f76176ac0364cc2a47894e03da678099c
1 file changed
+2
-2
docs/docs/introducing-jsx.md
+2
-2
@@ -48,7 +48,7 @@ ReactDOM.render(
48
49
[Try it on CodePen.](http://codepen.io/gaearon/pen/PGEjdG?editors=0010)
50
51
-We wrapped JSX in parentheses and split it over multiple lines for readability. This also helps avoid the pitfalls of [automatic semicolon insertion](http://stackoverflow.com/q/2846283).
51
+While it isn't mandatory, when doing this, we also recommend wrapping it in parentheses to avoid the pitfalls of [automatic semicolon insertion](http://stackoverflow.com/q/2846283)
52
53
### JSX is an Expression Too
54
@@ -114,7 +114,7 @@ const title = response.potentiallyMaliciousInput;
114
const element = <h1>{title}</h1>;
115
```
116
117
-By default, React DOM escapes any values embedded in JSX before rendering them.
117
+By default, React DOM [escapes](http://stackoverflow.com/questions/7381974/which-characters-need-to-be-escaped-on-html) any values embedded in JSX before rendering them. Thus it ensures that you can never inject anything that's not explicitly written in your application. Everything is converted to a string before being rendered. This helps prevent [XSS (cross-site-scripting)](https://en.wikipedia.org/wiki/Cross-site_scripting) attacks.
118
119
### JSX Represents Objects
120