From 9ccee7f475df23a679cef614eedd7d99ba011274 Mon Sep 17 00:00:00 2001 From: Cheng Lou Date: Fri, 27 Sep 2013 02:32:59 -0400 Subject: [PATCH] new entry on self-closing tag --- cookbook/cb-04-self-closing-tag tip.md | 11 +++++++++++ cookbook/cb-04-self-closing-tag.md | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 cookbook/cb-04-self-closing-tag tip.md create mode 100644 cookbook/cb-04-self-closing-tag.md diff --git a/cookbook/cb-04-self-closing-tag tip.md b/cookbook/cb-04-self-closing-tag tip.md new file mode 100644 index 000000000..747d54b94 --- /dev/null +++ b/cookbook/cb-04-self-closing-tag tip.md @@ -0,0 +1,11 @@ +--- +id: self-closing-tag +title: Self-Closing Tag +layout: docs +permalink: inline-styles.html +script: "cookbook/inline-styles.js" +--- + +In JSX, `` alone is valid while `` isn't. + +Related: every React component can be self-closing where it makes sense: `
`. diff --git a/cookbook/cb-04-self-closing-tag.md b/cookbook/cb-04-self-closing-tag.md new file mode 100644 index 000000000..c7b8dfc89 --- /dev/null +++ b/cookbook/cb-04-self-closing-tag.md @@ -0,0 +1,16 @@ +--- +id: self-closing-tag +title: Self-Closing Tag +layout: docs +permalink: inline-styles.html +script: "cookbook/inline-styles.js" +--- + +### Problem +You're getting a parsing error (unexpected token) from JSX. + +### Solution +One of the reasons might be that you didn't put a `/` for your self-closing tags. `` is valid while `` isn't. + +### Discussion +Every React component can be self-closing where it makes sense: `
`.