The demo Code problem of React concept in the official document of React

1. There is a problem. I don"t know what"s wrong.

Uncaught SyntaxError: Inline Babel script: Unexpected token, expected , (68:33)
  66 |                                 <td colSpan="2"><ProductCategoryRow category={item[0].category} /></td>
  67 |                                 </tr>   
> 68 |                                  {item.map((line) => {
     |                                  ^
  69 |                                             return  (<ProductRow name={line.name} price={line.price} key={line.name}/>)}
  70 |                                         )}
  71 |                                         
    at Parser.pp$5.raise (babel.js:17994)
    at Parser.pp.unexpected (babel.js:15337)
    at Parser.pp.expect (babel.js:15325)
    at Parser.pp$3.parseParenAndDistinguishExpression (babel.js:17368)
    at Parser.pp$3.parseExprAtom (babel.js:17263)
    at Parser.parseExprAtom (babel.js:20637)
    at Parser.pp$3.parseExprSubscripts (babel.js:17048)
    at Parser.pp$3.parseMaybeUnary (babel.js:17028)
    at Parser.pp$3.parseExprOps (babel.js:16958)
    at Parser.pp$3.parseMaybeConditional (babel.js:16935)


2. Partial code with error:

class ProductTable extends React.Component {
            constructor(props) {
                super(props);
            }

            render() {
                return (
                    <table>
                    <thead>
                        <tr>
                            <th><span className="title">Name</span></th>
                            <th><span className="title">Price</span></th>
                        </tr>
                        </thead>
                        <tbody>
                            {this.props.categoryArray.map((item,index) => {
                            return (
                                <tr key={index}>
                                <td colSpan="2"><ProductCategoryRow category={item[0].category} /></td>
                                </tr>   
                                 {item.map((line) => {
                                            return  (<ProductRow name={line.name} price={line.price} key={line.name}/>)}
                                        )}
                                        
                            )})}
                            
                            </tbody>
                    </table>
                )
            }
        }

3. Document link https://doc.react-china.org/d.

Mar.09,2021

have you added babel yet?
add a file .bablerc

to /
{
  "presets": [
    "es2015",
    "stage-0",
    "react"
  ]
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4b9d7-65462.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4b9d7-65462.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?