diff --git a/docs/docs/02.2-jsx-gotchas.md b/docs/docs/02.2-jsx-gotchas.md index cc867406e8..0b89ad18db 100644 --- a/docs/docs/02.2-jsx-gotchas.md +++ b/docs/docs/02.2-jsx-gotchas.md @@ -1,14 +1,16 @@ --- id: jsx-gotchas -title: JSX gotchas +title: JSX Gotchas layout: docs permalink: jsx-gotchas.html prev: jsx-in-depth.html next: interactivity-and-dynamic-uis.html --- + JSX looks like HTML but there are some important differences you may run into. -## Whitespace removal + +## Whitespace Removal JSX doesn't follow the same whitespace elimination rules as HTML. JSX removes all whitespace between two curly braces expressions. If you want to have whitespace, simply add `{' '}`. @@ -18,6 +20,7 @@ JSX doesn't follow the same whitespace elimination rules as HTML. JSX removes al Follow [Issue #65](https://github.com/facebook/react/issues/65) for discussion on this behavior. + ## HTML Entities You can insert HTML entities within literal text in JSX: @@ -58,6 +61,7 @@ As a last resort, you always have the ability to insert raw HTML.
``` + ## Custom HTML Attributes If you pass properties to native HTML elements that do not exist in the HTML specification, React will not render them. If you want to use a custom attribute, you should prefix it with `data-`.