Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  
  <div id="box"></div>
  
  
  <script src="https://fb.me/react-with-addons-15.1.0.js"></script>
  <script src="https://fb.me/react-dom-15.1.0.js"></script>
</body>
</html>
 
var data = [
 {
  product:"one",
  quantiy:2
 },
 {
  product:"two",
  quantiy:4
 },
 {
  product:"three",
  quantiy:3
 }
];
class App extends React.Component {
    
  constructor(props){
    super(props);
      this.state= {
        data: data
      }
    }
  render() {
    console.log(this.state);
      return (
        <div>
          <h1>Heading</h1>
            <div>{this.state.data.map( item => (
              <li>{item.product}</li>
              ))}
            </div>
          </div>
        );
    }   //render
};
ReactDOM.render(
  <App />,
  document.getElementById('box')
);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
kavishmehtapro
0viewers