className: Tag Style.tags, 9 | }, > 10 | this.props.value.map(function(value, index) { | ^ 11 | return React.createElement('li', { 12 | className: Tag Style.tag, 13 | key: index code example
Example: using dot notation in jsx
import React, { Component } from 'react';
export default const MenuItem = ({ children }) => <li>{children}</li>;
export default class Menu extends Component {
static Item = MenuItem;
render() {
return (
<ul>{this.props.children}</ul>
);
}
}
import React from 'react';
import { render } from 'react-dom';
import Menu from './menu';
const App = () => (
<Menu>
<Menu.Item>Home</Menu.Item>
<Menu.Item>Blog</Menu.Item>
<Menu.Item>About</Menu.Item>
</Menu>
);
render(<App />, document.getElementById('root'));