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 00000000..747d54b9 --- /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 00000000..c7b8dfc8 --- /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: `
`.