diff --git a/cookbook/cb-05-jsx-root-node-count tip.md b/cookbook/cb-05-jsx-root-node-count tip.md new file mode 100644 index 00000000..86a49a10 --- /dev/null +++ b/cookbook/cb-05-jsx-root-node-count tip.md @@ -0,0 +1,10 @@ +--- +id: jsx-root-node-count-tip +title: Maximum number of JSX root nodes +layout: docs +permalink: jsx-root-node-count-tip.html +--- + +Currently in `render`, you can only return one node; if you have, say, a list of divs to return, you must wrap your components within, say, one big `div` or `span` (or any other component). + +Don't forget that JSX compiles into regular js, and returning two functions doesn't really make syntactic sense. diff --git a/cookbook/cb-05-jsx-root-node-count.md b/cookbook/cb-05-jsx-root-node-count.md new file mode 100644 index 00000000..d74b02cd --- /dev/null +++ b/cookbook/cb-05-jsx-root-node-count.md @@ -0,0 +1,15 @@ +--- +id: jsx-root-node-count +title: Maximum number of JSX root nodes +layout: docs +permalink: jsx-root-node-count.html +--- + +### Problem +You're getting a parsing error from JSX. + +### Solution +You might have tried to return more than one node from JSX in `render`. Currently, you can only return one node; meaning that you must wrap your components within, say, a `div` or a `span` (or any other component). + +### Discussion +Don't forget that JSX compiles into regular js, and returning two functions doesn't really make syntactic sense.