From 7db2a09c9775f932b1c16faf7254831dfa1bac08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Tue, 16 Jul 2013 23:27:36 -0700 Subject: [PATCH] Cleanup "JSX Gotchas" --- docs/02.2-jsx-gotchas.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/02.2-jsx-gotchas.md b/docs/02.2-jsx-gotchas.md index cc867406..0b89ad18 100644 --- a/docs/02.2-jsx-gotchas.md +++ b/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-`.